lkml.org 
[lkml]   [2008]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 06/11] memcg: make inactive_anon_is_low()
Date
> > +/*
> > + * 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.





\
 
 \ /
  Last update: 2008-12-04 07:17    [W:0.063 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site