From: huangzq2 Date: Fri, 25 Jan 2019 09:46:58 +0000 (+0800) Subject: balance anon/file reclaim X-Git-Tag: MMI-RSBS31.Q1-48-36-26~290 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f5441263df584b36f3ef18e305e80182fd550214;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git balance anon/file reclaim Change-Id: I0ad49bb3e6b0b20fc2f23f8cf3a08e73f7cc2b00 Signed-off-by: huangzq2 Reviewed-on: https://gerrit.mot.com/1301255 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Hua Tan Submit-Approved: Jira Key --- diff --git a/arch/arm64/configs/ext_config/moto-erd9610.config b/arch/arm64/configs/ext_config/moto-erd9610.config index 7a3f50f19bcf..ed78a6994cca 100644 --- a/arch/arm64/configs/ext_config/moto-erd9610.config +++ b/arch/arm64/configs/ext_config/moto-erd9610.config @@ -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 diff --git a/mm/Kconfig b/mm/Kconfig index bc9748ed82f1..656af28886ea 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -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 diff --git a/mm/vmscan.c b/mm/vmscan.c index 9734e62654fa..f9df0265e859 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -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;