Re: [PATCH 2/3][v2] vmstat: add anon_scan_ratio field to zoneinfo

From: KOSAKI Motohiro
Date: Sun Jan 17 2010 - 21:15:01 EST


> >> It can make stale data when high memory pressure happens.
> >
> > ?? why? and when?
> > I think it depend on what's stale mean.
> >
> > Currently(i.e. before the patch), get_scan_ratio have following fomula.
> > in such region, recent_scanned is not protected by zone->lru_lock.
> >
> > Â Â Â Âap = (anon_prio + 1) * (reclaim_stat->recent_scanned[0] + 1);
> > Â Â Â Âap /= reclaim_stat->recent_rotated[0] + 1;
> > Â Â Â Âfp = (file_prio + 1) * (reclaim_stat->recent_scanned[1] + 1);
> > Â Â Â Âfp /= reclaim_stat->recent_rotated[1] + 1;
> > Â Â Â Âpercent[0] = 100 * ap / (ap + fp + 1);
> > Â Â Â Âpercent[1] = 100 - percent[0];
> >
> > It mean, shrink_zone() doesn't use exactly recent_scanned value. then
> > zoneinfo can use the same unexactly value.
>
> Absoultely right. I missed that. Thanks.
> get_scan_ratio used lru_lock to get reclaim_stat->recent_xxxx.
> But, it doesn't used lru_lock to get ap/fp.
>
> Is it intentional? I think you or Rik know it. :)
> I think if we want to get exact value, we have to use lru_lock until
> getting ap/fp.
> If it isn't, we don't need lru_lock when we get the reclaim_stat->recent_xxxx.
>
> What do you think about it?

I believe the current code is intentional.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/