From: Glauber Costa <glommer@openvz.org>
To: linux-mm@kvack.org
Cc: cgroups@vger.kernel.org, Tejun Heo <tj@kernel.org>,
Michal Hocko <mhocko@suse.cz>,
Johannes Weiner <hannes@cmpxchg.org>,
kamezawa.hiroyu@jp.fujitsu.com,
Glauber Costa <glommer@openvz.org>
Subject: [PATCH] memcg: do not account memory used for cache creation
Date: Tue, 4 Jun 2013 18:10:59 +0400 [thread overview]
Message-ID: <1370355059-24968-1-git-send-email-glommer@openvz.org> (raw)
The memory we used to hold the memcg arrays is currently accounted to
the current memcg. But that creates a problem, because that memory can
only be freed after the last user is gone. Our only way to know which is
the last user, is to hook up to freeing time, but the fact that we still
have some in flight kmallocs will prevent freeing to happen. I believe
therefore to be just easier to account this memory as global overhead.
Signed-off-by: Glauber Costa <glommer@openvz.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
I noticed this while testing nuances of the shrinker patches. The
caches would basically stay present forever, even if we managed to
flush all of the actual memory being used. With this patch applied,
they would go away all right.
---
mm/memcontrol.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 5d8b93a..aa1cbd4 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5642,7 +5642,9 @@ static int memcg_propagate_kmem(struct mem_cgroup *memcg)
static_key_slow_inc(&memcg_kmem_enabled_key);
mutex_lock(&set_limit_mutex);
+ memcg_stop_kmem_account();
ret = memcg_update_cache_sizes(memcg);
+ memcg_resume_kmem_account();
mutex_unlock(&set_limit_mutex);
out:
return ret;
--
1.8.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:[~2013-06-04 14:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-04 14:10 Glauber Costa [this message]
2013-06-07 9:21 ` [PATCH] memcg: do not account memory used for cache creation Michal Hocko
2013-06-07 10:11 ` Glauber Costa
2013-06-07 14:12 ` Michal Hocko
2013-06-07 14:45 ` Glauber Costa
2013-06-07 15:54 ` Michal Hocko
2013-06-09 11:57 ` Glauber Costa
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=1370355059-24968-1-git-send-email-glommer@openvz.org \
--to=glommer@openvz.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=tj@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).