summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/Kconfig9
-rw-r--r--mm/vmscan.c3
2 files changed, 11 insertions, 1 deletions
diff --git a/mm/Kconfig b/mm/Kconfig
index 97a4e06b15c0..3ca6a255de03 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -619,6 +619,15 @@ config MAX_STACK_SIZE_MB
A sane initial value is 80 MB.
+config BALANCE_ANON_FILE_RECLAIM
+ bool "During reclaim treat anon and file backed pages equally"
+ depends on SWAP
+ help
+ When performing memory reclaim treat anonymous and file backed pages
+ equally.
+ Swapping anonymous pages out to memory can be efficient enough to justify
+ treating anonymous and file backed pages equally.
+
# For architectures that support deferred memory initialisation
config ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT
bool
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 3b951836c6c8..9f844e8b92df 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2094,7 +2094,8 @@ static void get_scan_count(struct lruvec *lruvec, int swappiness,
* There is enough inactive page cache, do not reclaim
* anything from the anonymous working set right now.
*/
- if (!inactive_file_is_low(lruvec)) {
+ if (!IS_ENABLED(CONFIG_BALANCE_ANON_FILE_RECLAIM) &&
+ !inactive_file_is_low(lruvec)) {
scan_balance = SCAN_FILE;
goto out;
}