Re: 2.6.3-mm3

Mike Fedyk
2004-02-26T04:56:46Z

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

Nick Piggin wrote:
> IMO, shrink_slab-for-all-zones.patch and zone-balancing-fix.patch
> should be all you need although they won't shrink the slab as
> much as mm3. They should be pretty easy to port by hand.

How does this patch for 2.6.3 look?

[-- Attachment #2: 2.6.3-shrink_slab-for-all-zones.patch --]
[-- Type: text/x-patch, Size: 1275 bytes --]

--- linux-2.6.3/mm/vmscan.c 2004-02-25 20:50:35.000000000 -0800
+++ linux-2.6.3-slab-lofft/mm/vmscan.c 2004-02-25 20:41:45.000000000 -0800
@@ -885,12 +885,10 @@

/* Take a nap, wait for some writeback to complete */
blk_congestion_wait(WRITE, HZ/10);
- if (zones[0] - zones[0]->zone_pgdat->node_zones < ZONE_HIGHMEM) {
- shrink_slab(total_scanned, gfp_mask);
- if (reclaim_state) {
- nr_reclaimed += reclaim_state->reclaimed_slab;
- reclaim_state->reclaimed_slab = 0;
- }
+ shrink_slab(total_scanned, gfp_mask);
+ if (reclaim_state) {
+ nr_reclaimed += reclaim_state->reclaimed_slab;
+ reclaim_state->reclaimed_slab = 0;
}
}
if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY))
@@ -962,11 +960,9 @@
max_scan = SWAP_CLUSTER_MAX;
to_free -= shrink_zone(zone, max_scan, GFP_KERNEL,
to_reclaim, &nr_mapped, ps, priority);
- if (i < ZONE_HIGHMEM) {
- reclaim_state->reclaimed_slab = 0;
- shrink_slab(max_scan + nr_mapped, GFP_KERNEL);
- to_free -= reclaim_state->reclaimed_slab;
- }
+ reclaim_state->reclaimed_slab = 0;
+ shrink_slab(nr_scanned, GFP_KERNEL);
+ reclaimed += reclaim_state->reclaimed_slab;
if (zone->all_unreclaimable)
continue;
if (zone->pages_scanned > zone->present_pages * 2)