From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: Vladimir Davydov <vdavydov.dev@gmail.com>,
Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@kernel.org>,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] memcg: Add comment to mem_cgroup_css_online()
Date: Thu, 2 Aug 2018 11:13:24 +0300 [thread overview]
Message-ID: <521f9e5f-c436-b388-fe83-4dc870bfb489@virtuozzo.com> (raw)
In-Reply-To: <7a836e47-f0a4-6802-9b90-cc473e5ab90b@virtuozzo.com>
Explain relationships between allocation and expanding.
Suggested-by: Vladimir Davydov <vdavydov.dev@gmail.com>
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d90993ef1d7d..34e5ff72ce87 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4703,6 +4703,11 @@ static int mem_cgroup_css_online(struct cgroup_subsys_state *css)
{
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
+ /*
+ * A memcg must be visible for memcg_expand_shrinker_maps()
+ * by the time the maps are allocated. So, we allocate maps
+ * here, when for_each_mem_cgroup() can't skip it.
+ */
if (memcg_alloc_shrinker_maps(memcg)) {
mem_cgroup_id_remove(memcg);
return -ENOMEM;
next prev parent reply other threads:[~2018-08-02 8:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-12 14:52 [PATCH] memcg: Remove memcg_cgroup::id from IDR on mem_cgroup_css_alloc() failure Kirill Tkhai
2018-04-13 8:55 ` Michal Hocko
2018-04-13 9:35 ` Kirill Tkhai
2018-04-13 11:02 ` Michal Hocko
2018-04-13 11:06 ` Kirill Tkhai
2018-04-13 11:20 ` Michal Hocko
2018-04-13 11:29 ` Kirill Tkhai
2018-04-13 11:38 ` Michal Hocko
2018-04-13 11:49 ` Kirill Tkhai
2018-04-13 11:54 ` Michal Hocko
2018-04-13 12:07 ` Kirill Tkhai
2018-04-13 12:14 ` Michal Hocko
2018-04-13 12:51 ` Michal Hocko
2018-07-26 23:25 ` Andrew Morton
2018-07-27 19:31 ` Johannes Weiner
2018-07-29 19:26 ` Vladimir Davydov
2018-07-30 15:31 ` Johannes Weiner
2018-07-31 23:39 ` Andrew Morton
2018-08-01 15:55 ` Johannes Weiner
2018-08-01 16:22 ` Vladimir Davydov
2018-08-02 8:03 ` Kirill Tkhai
2018-08-02 8:13 ` Kirill Tkhai [this message]
2018-08-01 16:16 ` Vladimir Davydov
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=521f9e5f-c436-b388-fe83-4dc870bfb489@virtuozzo.com \
--to=ktkhai@virtuozzo.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=vdavydov.dev@gmail.com \
/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).