ANBZ: #80
commit 37bc3cb9bbef86d1ddbbc789e55b588c8a2cac26 upstream
Since commit c843966c556d ("mm: allow swappiness that prefers reclaiming
anon over the file workingset") has expended the swappiness value to make
swap to be preferred in some systems. We should also change the memcg
swappiness restriction to allow memcg swap-preferred.
Link:
https://lkml.kernel.org/r/d77469b90c45c49953ccbc51e54a1d465bc18f70.16276262…
Fixes: c843966c556d ("mm: allow swappiness that prefers reclaiming anon over the file
workingset")
Signed-off-by: Baolin Wang <baolin.wang(a)linux.alibaba.com>
Acked-by: Michal Hocko <mhocko(a)suse.com>
Cc: Johannes Weiner <hannes(a)cmpxchg.org>
Cc: Vladimir Davydov <vdavydov.dev(a)gmail.com>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds(a)linux-foundation.org>
---
Note: From mysql testing, we found the pagecache pages used to record
logs will bring thrashing, and we can increase the swappiness to mitigate
the thrashing by increasing the scanning propotion of anon pages when do
demotion, which can improve about 2% performance.
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index df08e95..580ab02 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4520,7 +4520,7 @@ static int mem_cgroup_swappiness_write(struct cgroup_subsys_state
*css,
{
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
- if (val > 100 || val < -1 || (css->parent && val < 0))
+ if (val > 200 || val < -1 || (css->parent && val < 0))
return -EINVAL;
if (css->parent)
--
1.8.3.1