From 79efc682ce2371a14a5283284023665a1e7e7524 Mon Sep 17 00:00:00 2001 From: Unsung Lee Date: Mon, 13 Jun 2022 16:25:01 +0900 Subject: [PATCH] conf: update MemoryLevelThreshold, MemoryDedup, and MemoryCompaction Change-Id: I24e08743e909a94b91dc1077f3a48fa1e1664d00 Signed-off-by: Unsung Lee --- conf/limiter.conf | 11 +++++------ conf/optimizer.conf | 14 +++++++------- src/resource-limiter/memory/vmpressure-lowmem-handler.c | 15 +++++++++++---- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/conf/limiter.conf b/conf/limiter.conf index b8d1c2d..bd491b6 100644 --- a/conf/limiter.conf +++ b/conf/limiter.conf @@ -1,10 +1,9 @@ - [MemoryLevelThreshold] -#MediumLevel= 20% -#LowLevel= 15% -#CriticalLevel= 10% -#OomLevel= 7% -OomPopup= no +MediumLevel= 25% +LowLevel= 15% +CriticalLevel= 10% +OomLevel= 7% +OomPopup= no [MemoryAppTypeLimit] ServicePerAppLimitAction=128MB,kill diff --git a/conf/optimizer.conf b/conf/optimizer.conf index 9e5ace1..d29a83b 100644 --- a/conf/optimizer.conf +++ b/conf/optimizer.conf @@ -12,18 +12,18 @@ PoolRatio=40 PoolType=z3fold [MemoryDedup] -#DedupAtBoot=yes -#ScanOnLowmem=yes +DedupAtBoot=yes +ScanOnLowmem=yes [MemoryKsm] -#KsmMode=oneshot -#KsmMode=periodic +KsmMode=oneshot +KsmMode=periodic -#PagesToScan=100 -#PagesToScanWithBoost=1000 +PagesToScan=100 +PagesToScanWithBoost=1000 [MemoryCompaction] -#FragLevel=800 +FragLevel=800 [CpuSched] #CpuSchedFeature=no_rt_runtime_share diff --git a/src/resource-limiter/memory/vmpressure-lowmem-handler.c b/src/resource-limiter/memory/vmpressure-lowmem-handler.c index 8181479..89cb30c 100644 --- a/src/resource-limiter/memory/vmpressure-lowmem-handler.c +++ b/src/resource-limiter/memory/vmpressure-lowmem-handler.c @@ -1746,17 +1746,24 @@ static void load_configs(void) memcg_set_threshold(MEMCG_ROOT, lvl, calculate_threshold_size(memcg_conf->threshold[lvl].threshold)); - if (lvl == MEM_LEVEL_OOM) + if (lvl == MEM_LEVEL_OOM) { memcg_set_leave_threshold(MEMCG_ROOT, - get_memcg_info(MEMCG_ROOT)->threshold_mb[lvl] * 2); + get_memcg_info(MEMCG_ROOT)->threshold_mb[lvl] * 1.5); + proactive_threshold_mb = get_memcg_info(MEMCG_ROOT)->threshold_leave_mb; + proactive_leave_mb = proactive_threshold_mb * 1.5; + } } else if (memcg_conf->threshold[lvl].threshold > 0) { memcg_set_threshold(MEMCG_ROOT, lvl, memcg_conf->threshold[lvl].threshold); - if (lvl == MEM_LEVEL_OOM) + if (lvl == MEM_LEVEL_OOM) { memcg_set_leave_threshold(MEMCG_ROOT, - get_memcg_info(MEMCG_ROOT)->threshold_mb[lvl] * 2); + get_memcg_info(MEMCG_ROOT)->threshold_mb[lvl] * 1.5); + proactive_threshold_mb = get_memcg_info(MEMCG_ROOT)->threshold_leave_mb; + proactive_leave_mb = proactive_threshold_mb * 1.5; + } + } } oom_popup_enable = memcg_conf->oom_popup; -- 2.7.4