balance anon/file reclaim
authorhuangzq2 <huangzq2@motorola.com>
Fri, 25 Jan 2019 09:46:58 +0000 (17:46 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:30:39 +0000 (17:30 +0800)
Change-Id: I0ad49bb3e6b0b20fc2f23f8cf3a08e73f7cc2b00
Signed-off-by: huangzq2 <huangzq2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1301255
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Hua Tan <tanhua1@motorola.com>
Submit-Approved: Jira Key

arch/arm64/configs/ext_config/moto-erd9610.config
mm/Kconfig
mm/vmscan.c

index 7a3f50f19bcffeaa3709469d933e4a5c897bfe77..ed78a6994cca769ee959707a90885d80e49767e6 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_SUSPEND_SKIP_SYNC=y
 CONFIG_CMA_SIZE_MBYTES=22
 CONFIG_MEMCG=y
 CONFIG_MEMCG_SWAP=y
+CONFIG_BALANCE_ANON_FILE_RECLAIM=y
 # CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
 # CONFIG_KSM is not set
 # CONFIG_PAGE_OWNER is not set
index bc9748ed82f1e6381bf76833e67099222f0bf465..656af28886eaedd4781daeff547966ff78d55131 100644 (file)
@@ -639,6 +639,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.
+
 config HPA
        bool "High-order Pages Allocator"
        select CMA
index 9734e62654fa85840de87785f99d0603a2d79914..f9df0265e8596234c072ea02868b76f5c36375ff 100644 (file)
@@ -2285,7 +2285,8 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg,
         * lruvec even if it has plenty of old anonymous pages unless the
         * system is under heavy pressure.
         */
-       if (!inactive_list_is_low(lruvec, true, memcg, sc, false) &&
+       if (!IS_ENABLED(CONFIG_BALANCE_ANON_FILE_RECLAIM) &&
+           !inactive_list_is_low(lruvec, true, memcg, sc, false) &&
            lruvec_lru_size(lruvec, LRU_INACTIVE_FILE, sc->reclaim_idx) >> sc->priority) {
                scan_balance = SCAN_FILE;
                goto out;