VM regression in 2.6.7-bk20

From: Shantanu Goel
Date: Mon Jul 12 2004 - 00:18:33 EST


Hi,

I believe there is VM regression due to the recent
changes to the page scanner. It stems from the fact
that shrink_zone() limits # pages reclaimed in one go
to SWAP_CLUSTER_MAX instead of basing it on the memory
shortfall which causes increased pressure on the lower
zones. I first noticed this while running my normal
workstation workload. The machine seemed to swap more
than I expected because the # mapped pages was only
about 30%. I noticed the DMA zone was being scanned
very frequently while running a script that monitored
/proc/vmstat. The "swappiness" value was the default
60. Unfortunately, I failed to save the output so if
the statistics below are insufficient evidence, I can
reboot the stock kernel and get the output.

Below are the VM statistics for stock 2.6.7-bk20 and
modified 2.6.7-bk20 which sets sc.nr_to_reclaim to
zone->pages_high - zone->free_pages. The statistics
were collected by a perl script that read /proc/vmstat
before and after running the benchmark and printing
the difference. "swappiness" was again the default
value 60 in both cases. I used kernbench with options
"-H -M" using the source for 2.6.0 so only the optimal
load (-j16) was run. The machine has 2x2.0Ghz Xeons
with HT enabled and I manually booted it with mem=256M
though it has 1GB of memory.

modified stock
pgscan_kswapd_normal 750420 655116
pgscan_direct_normal 561924 497640
pgscan_kswapd_dma 121903 390318
pgscan_direct_dma 78258 153638
pgsteal_normal 631517 575534
pgsteal_dma 67128 125950

Notice that the stock kernel scanned the DMA zone
about 3 times as often than the modified one, and
allocated twice as much memory from the DMA zone.

The modification I made is attached below. This is
not meant for inclusion as the sysctls (limit_reclaim,
slow_scan) are for testing only. Please ignore the
slow_scan stuff. It was disabled during the tests
above and is something I was playing with on the side.
The scanner used the stock algorithm in both cases
for deciding how much of the active/inactive lists to
scan.
I used limit_reclaim to enable/disable the stock
reclaim behaviour.

Thanks,
Shantanu




__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

Attachment: vmscan.patch
Description: vmscan.patch