All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Glauber Costa <glommer-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>,
	Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	cgroups <cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	KAMEZAWA Hiroyuki
	<kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
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-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>

>>  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.

WARNING: multiple messages have this Message-ID (diff)
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>

WARNING: multiple messages have this Message-ID (diff)
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.


  parent reply	other threads:[~2013-06-14  1:17 UTC|newest]

Thread overview: 15+ 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  9:12 ` Li Zefan
2013-06-13  9:12 ` Li Zefan
     [not found] ` <51B98D17.2050902-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-06-13 15:53   ` Michal Hocko
2013-06-13 15:53     ` Michal Hocko
2013-06-13 15:53     ` Michal Hocko
2013-06-13 15:54     ` Michal Hocko
2013-06-13 15:54       ` Michal Hocko
     [not found]     ` <20130613155319.GJ23070-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2013-06-14  1:17       ` Li Zefan [this message]
2013-06-14  1:17         ` Li Zefan
2013-06-14  1:17         ` Li Zefan
2013-06-14 10:56         ` Glauber Costa
2013-06-14 10:56           ` Glauber Costa
2013-06-13 19:53 ` Tejun Heo
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-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=glommer-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.