From: Vladimir Davydov <vdavydov@virtuozzo.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mm: memcontrol: reset memory.low on css offline
Date: Mon, 29 Feb 2016 20:16:33 +0300 [thread overview]
Message-ID: <1456766193-16255-1-git-send-email-vdavydov@virtuozzo.com> (raw)
When a cgroup directory is removed, the memory cgroup subsys state does
not disappear immediately. Instead, it's left hanging around until the
last reference to it is gone, which implies reclaiming all pages from
its lruvec.
In the unified hierarchy, there's the memory.low knob, which can be used
to set a best-effort protection for a memory cgroup - the reclaimer
first scans those cgroups whose consumption is above memory.low, and
only if it fails to reclaim enough pages, it gets to the rest.
Currently this protection is not reset when the cgroup directory is
removed. As a result, if a dead memory cgroup has a lot of page cache
charged to it and a high value of memory.low, it will result in higher
pressure exerted on live cgroups, and userspace will have no ways to
detect such consumers and reconfigure memory.low properly.
To fix this, let's reset memory.low on css offline.
Signed-off-by: Vladimir Davydov <vdavydov@virtuozzo.com>
---
mm/memcontrol.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index ae8b81c55685..ab7bfe870c7d 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4214,6 +4214,8 @@ static void mem_cgroup_css_offline(struct cgroup_subsys_state *css)
memcg_offline_kmem(memcg);
wb_memcg_offline(memcg);
+
+ memcg->low = 0;
}
static void mem_cgroup_css_released(struct cgroup_subsys_state *css)
--
2.1.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2016-02-29 17:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-29 17:16 Vladimir Davydov [this message]
2016-02-29 18:29 ` [PATCH] mm: memcontrol: reset memory.low on css offline Michal Hocko
2016-02-29 20:02 ` Johannes Weiner
2016-02-29 20:55 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456766193-16255-1-git-send-email-vdavydov@virtuozzo.com \
--to=vdavydov@virtuozzo.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).