summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiam Mark <lmark@codeaurora.org>2014-04-11 17:26:15 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:03:26 -0700
commit585690954ef42cfcda9357a37b6e9e8ccdd33d7c (patch)
tree6308cd09de30bc69337fbee92f0ef8342f11a56b
parent80370b5f592b4ee469f23447e1517cd78d0860ef (diff)
mm: vmscan: support equal reclaim for anon and file pages
When performing memory reclaim support treating 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. CRs-Fixed: 648984 Change-Id: I6315b8557020d1e27a34225bb9cefbef1fb43266 Signed-off-by: Liam Mark <lmark@codeaurora.org>
-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;
}