On Tue, Apr 06, 2010 at 09:25:36AM +0800, Li, Shaohua wrote:
1 anon page scanned for every N file pages scanned?
Is N a _huge_ enough ratio so that the anon list will be very light scanned?
Rik: here is a little background.
Under streaming IO, the current get_scan_ratio() will get a percent[0]
that is (much) less than 1, so underflows to 0.
It has the bad effect of completely disabling the scan of anon list,
which leads to OOM in Shaohua's test case. OTOH, it also has the good
side effect of keeping anon pages in memory and totally prevent swap
IO.
Shaohua's patch improves the computation precision by computing nr[]
directly in get_scan_ratio(). This is good in general, however will
enable light scan of the anon list on streaming IO.
Thanks,
Fengguang
--