From: Andi Kleen Date: Tue, 28 Sep 2010 05:37:55 +0000 (+0200) Subject: HWPOISON: Stop shrinking at right page count X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=47f43e7efadacc627f325aba64c6a547de0926db;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git HWPOISON: Stop shrinking at right page count When we call the slab shrinker to free a page we need to stop at page count one because the caller always holds a single reference, not zero. This avoids useless looping over slab shrinkers and freeing too much memory. Reviewed-by: Wu Fengguang Signed-off-by: Andi Kleen --- diff --git a/mm/memory-failure.c b/mm/memory-failure.c index cd7e6974de77..757f6b0accfe 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -235,7 +235,7 @@ void shake_page(struct page *p, int access) int nr; do { nr = shrink_slab(1000, GFP_KERNEL, 1000); - if (page_count(p) == 0) + if (page_count(p) == 1) break; } while (nr > 10); }