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:	Mon, 19 Sep 2011 15:06:57 +0200
From:	Michal Hocko <mhocko@...e.cz>
To:	"Kirill A. Shutemov" <kirill@...temov.name>
Cc:	Johannes Weiner <jweiner@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
	Balbir Singh <bsingharora@...il.com>,
	Ying Han <yinghan@...gle.com>,
	Greg Thelen <gthelen@...gle.com>,
	Michel Lespinasse <walken@...gle.com>,
	Rik van Riel <riel@...hat.com>,
	Minchan Kim <minchan.kim@...il.com>,
	Christoph Hellwig <hch@...radead.org>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [patch 01/11] mm: memcg: consolidate hierarchy iteration
 primitives

On Tue 13-09-11 01:37:46, Kirill A. Shutemov wrote:
> On Mon, Sep 12, 2011 at 12:57:18PM +0200, Johannes Weiner wrote:
[...]
> >  	while (1) {
> > -		victim = mem_cgroup_select_victim(root_memcg);
> > -		if (victim == root_memcg) {
> > +		victim = mem_cgroup_iter(root_memcg, victim, true);
> > +		if (!victim) {
> >  			loop++;
> >  			/*
> >  			 * We are not draining per cpu cached charges during
> > @@ -1689,10 +1644,8 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_memcg,
> >  				 * anything, it might because there are
> >  				 * no reclaimable pages under this hierarchy
> >  				 */
> > -				if (!check_soft || !total) {
> > -					css_put(&victim->css);
> > +				if (!check_soft || !total)
> >  					break;
> > -				}
> >  				/*
> >  				 * We want to do more targeted reclaim.
> >  				 * excess >> 2 is not to excessive so as to
> > @@ -1700,15 +1653,13 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_memcg,
> >  				 * coming back to reclaim from this cgroup
> >  				 */
> >  				if (total >= (excess >> 2) ||
> > -					(loop > MEM_CGROUP_MAX_RECLAIM_LOOPS)) {
> > -					css_put(&victim->css);
> > +					(loop > MEM_CGROUP_MAX_RECLAIM_LOOPS))
> >  					break;
> > -				}
> >  			}
> > +			continue;
> 
> Souldn't we do
> 
> victim = root_memcg;
> 
> instead?

You want to save mem_cgroup_iter call?
Yes it will work... I am not sure it is really an improvement. If we
just continue we can rely on mem_cgroup_iter doing the right thing.
Assignment might be not that obvious. But I dunno. 
-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic
--
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