[VM PATCH 2.6.8-rc1] Prevent excessive scanning of lower zone

From: Shantanu Goel
Date: Thu Jul 22 2004 - 20:42:26 EST


Hi Andrew,

I emailed this a few weeks back to the list but it
seems to have gotten lost...

The default page scanner limits # pages reclaimed to
SWAP_CLUSTER_MAX in shrink_zone() which causes greater
stress on the lower zones (DMA in my case) since
kswapd() is unable to keep up with allocations and
more memory is allocated from the lower zone. I
noticed while running my normal workstation load, the
kernel was paging more than I expected since amount of
mapped memory was only about 30% (swappiness = 60).

To demonstrate this, I have attached the difference in
/proc/vmstat when running kernbench in optimal mode
(-j16) between stock 2.6.8-rc1 and with the patch
applied. The patch modifies kswapd() to keep scanning
until free_pages is greater than pages_high. In both
cases swappiness is 60. The machine has 2x2.0Ghz
Xeons with HT enabled and memory manually limited to
256MB. Notice that the DMA zone is scanned more than
4 times more often in the stock kernel and there about
80000 more pgsteal's from the DMA zone compared to the
modified kernel.

Also, in try_to_free_pages() I changed it to test
total_reclaimed instead of sc.nr_reclaimed. Not sure
if that's an oversight or something else was intended
that I've failed to grasp...


Thanks,
Shantanu




__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo

Attachment: kb-2.6.8-rc1
Description: kb-2.6.8-rc1

Attachment: kb-2.6.8-rc1-vmfix
Description: kb-2.6.8-rc1-vmfix

Attachment: vm.patch
Description: vm.patch