lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 5 Feb 2014 14:49:56 +0100
From:	Michal Hocko <mhocko@...e.cz>
To:	Johannes Weiner <hannes@...xchg.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	LKML <linux-kernel@...r.kernel.org>, linux-mm@...ck.org
Subject: Re: [PATCH -v2 1/6] memcg: do not replicate
 try_get_mem_cgroup_from_mm in __mem_cgroup_try_charge

On Tue 04-02-14 17:05:21, Michal Hocko wrote:
> On Tue 04-02-14 10:55:08, Johannes Weiner wrote:
> > On Tue, Feb 04, 2014 at 02:28:55PM +0100, Michal Hocko wrote:
> > > Johannes Weiner has pointed out that __mem_cgroup_try_charge duplicates
> > > try_get_mem_cgroup_from_mm for charges which came without a memcg. The
> > > only reason seems to be a tiny optimization when css_tryget is not
> > > called if the charge can be consumed from the stock. Nevertheless
> > > css_tryget is very cheap since it has been reworked to use per-cpu
> > > counting so this optimization doesn't give us anything these days.
> > > 
> > > So let's drop the code duplication so that the code is more readable.
> > > While we are at it also remove a very confusing comment in
> > > try_get_mem_cgroup_from_mm.
> > > 
> > > Signed-off-by: Michal Hocko <mhocko@...e.cz>
> > > ---
> > >  mm/memcontrol.c | 49 ++++++++-----------------------------------------
> > >  1 file changed, 8 insertions(+), 41 deletions(-)
> > > 
> > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > > index 53385cd4e6f0..042e4ff36c05 100644
> > > --- a/mm/memcontrol.c
> > > +++ b/mm/memcontrol.c
> > > @@ -1081,11 +1081,7 @@ struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
> > >  
> > >  	if (!mm)
> > >  		return NULL;
> > 
> > While you're at it, this check also seems unnecessary.
> 
> Yes, it will be removed in a later patch. I wanted to have it in a
> separate patch for a better bisectability just in case I have really
> missed mm-might-by-NULL case.

Ohh, I have mixed that with the other mm check. You are right we can
remove this one as well. Thanks and sorry for confusion!
-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ