From c3f4656118a78c1c294e0b4d338ac946265a822b Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 29 Dec 2003 23:48:44 -0800 Subject: [PATCH] [PATCH] shrink_slab acounts for seeks incorrectly wli points out that shrink_slab inverts the sense of shrinker->seeks: those caches which require more seeks to reestablish an object are shrunk harder. That's wrong - they should be shrunk less. So fix that up, but scaling the result so that the patch is actually a no-op at this time, because all caches use DEFAULT_SEEKS (2). --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index b8594827bbac..f2da3c9fb346 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -154,7 +154,7 @@ static int shrink_slab(long scanned, unsigned int gfp_mask) list_for_each_entry(shrinker, &shrinker_list, list) { unsigned long long delta; - delta = scanned * shrinker->seeks; + delta = 4 * (scanned / shrinker->seeks); delta *= (*shrinker->shrinker)(0, gfp_mask); do_div(delta, pages + 1); shrinker->nr += delta; -- 2.39.5