From: Li Zefan <lizefan@huawei.com>
To: Michal Hocko <mhocko@suse.cz>
Cc: Tejun Heo <tj@kernel.org>, Glauber Costa <glommer@openvz.org>,
Johannes Weiner <hannes@cmpxchg.org>,
LKML <linux-kernel@vger.kernel.org>,
cgroups <cgroups@vger.kernel.org>,
linux-mm@kvack.org,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: [PATCH v3 5/9] memcg: use css_get/put when charging/uncharging kmem
Date: Fri, 14 Jun 2013 09:17:40 +0800 [thread overview]
Message-ID: <51BA6F34.30001@huawei.com> (raw)
In-Reply-To: <20130613155319.GJ23070@dhcp22.suse.cz>
>> static void memcg_kmem_mark_dead(struct mem_cgroup *memcg)
>> {
>> + /*
>> + * We need to call css_get() first, because memcg_uncharge_kmem()
>> + * will call css_put() if it sees the memcg is dead.
>> + */
>> + smb_wmb();
>> if (test_bit(KMEM_ACCOUNTED_ACTIVE, &memcg->kmem_account_flags))
>> set_bit(KMEM_ACCOUNTED_DEAD, &memcg->kmem_account_flags);
>
> I do not feel strongly about that but maybe open coding this in
> mem_cgroup_css_offline would be even better. There is only single caller
> and there is smaller chance somebody will use the function incorrectly
> later on.
>
> So I leave the decision on you because this doesn't matter much.
>
Yeah, it should go away soon. I'll post a patch after this patchset gets
merged into -mm tree and then we can discuss there.
--
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 prev parent reply other threads:[~2013-06-14 1:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 9:12 [PATCH v3 5/9] memcg: use css_get/put when charging/uncharging kmem Li Zefan
2013-06-13 15:53 ` Michal Hocko
2013-06-13 15:54 ` Michal Hocko
2013-06-14 1:17 ` Li Zefan [this message]
2013-06-14 10:56 ` Glauber Costa
2013-06-13 19:53 ` 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=51BA6F34.30001@huawei.com \
--to=lizefan@huawei.com \
--cc=cgroups@vger.kernel.org \
--cc=glommer@openvz.org \
--cc=hannes@cmpxchg.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--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).