summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2010-09-28 09:37:55 +0400
committerAndi Kleen <ak@linux.intel.com>2010-10-07 11:47:10 +0400
commit47f43e7efadacc627f325aba64c6a547de0926db (patch)
treee83afbf6be4f594d6f0cd1bf815e9469d4a14f18 /mm
parent0d9ee6a2d4a6e92c49e6fa9469e5731d21ee203e (diff)
downloadlinux-47f43e7efadacc627f325aba64c6a547de0926db.tar.xz
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 <fengguang.wu@intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory-failure.c2
1 files changed, 1 insertions, 1 deletions
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);
}