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]
Message-Id: <20081204151202.1D75.KOSAKI.MOTOHIRO@jp.fujitsu.com>
Date:	Thu,  4 Dec 2008 15:14:20 +0900 (JST)
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-mm <linux-mm@...ck.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Rik van Riel <riel@...hat.com>
Cc:	kosaki.motohiro@...fujitsu.com
Subject: Re: [PATCH 06/11] memcg: make inactive_anon_is_low()

> > +/*
> > + * The inactive anon list should be small enough that the VM never has to
> > + * do too much work, but large enough that each inactive page has a chance
> > + * to be referenced again before it is swapped out.
> > + *
> > + * this calculation is straightforward porting from
> > + * page_alloc.c::setup_per_zone_inactive_ratio().
> > + * it describe more detail.
> > + */
> > +static void mem_cgroup_set_inactive_ratio(struct mem_cgroup *memcg)
> > +{
> > +	unsigned int gb, ratio;
> > +
> > +	gb = res_counter_read_u64(&memcg->res, RES_LIMIT) >> 30;
> > +	if (gb)
> > +		ratio = int_sqrt(10 * gb);
> 
> I don't understand where the magic number 10 comes from?

the function comment write to

  this calculation is straightforward porting from
  page_alloc.c::setup_per_zone_inactive_ratio().
  it describe more detail.





> > @@ -1400,7 +1412,7 @@ static unsigned long shrink_list(enum lr
> >  	}
> > 
> >  	if (lru == LRU_ACTIVE_ANON &&
> > -	    (!scan_global_lru(sc) || inactive_anon_is_low(zone))) {
> > +	    inactive_anon_is_low(zone, sc)) {
> 
> Can't we merge the line with the "if" statement

Will fix.

thanks.



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