Re: Large slab cache in 2.6.1

From: Nick Piggin
Date: Sat Feb 21 2004 - 21:56:31 EST




Nick Piggin wrote:



Nick Piggin wrote:


I have an idea it might be worthwhile to try using inactive list
scanning as an input to slab pressure...


Err that is what it does, of course. My idea was the other way
round - use active list scanning as input. So no, that probably
won't help.

Only one way to find out though. Patch against 2.6.3-mm2.


*cough*

linux-2.6-npiggin/mm/vmscan.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN mm/vmscan.c~vm-inactive-shrink-slab mm/vmscan.c
--- linux-2.6/mm/vmscan.c~vm-inactive-shrink-slab 2004-02-22 13:39:45.000000000 +1100
+++ linux-2.6-npiggin/mm/vmscan.c 2004-02-22 13:45:01.000000000 +1100
@@ -797,6 +797,7 @@ static int
shrink_zone(struct zone *zone, unsigned int gfp_mask,
int nr_pages, int *nr_scanned, struct page_state *ps, int priority)
{
+ int ret;
unsigned long imbalance;
unsigned long nr_refill_inact;
unsigned long max_scan;
@@ -836,7 +837,10 @@ shrink_zone(struct zone *zone, unsigned
if (max_scan < nr_pages * 2)
max_scan = nr_pages * 2;

- return shrink_cache(nr_pages, zone, gfp_mask, max_scan, nr_scanned);
+ ret = shrink_cache(nr_pages, zone, gfp_mask, max_scan, nr_scanned);
+ /* Account for active list scanning too */
+ *nr_scanned += nr_refill_inact;
+ return ret;
}

/*

_