Commit 47f43e7efadacc627f325aba64c6a547de0926db

Authored by Andi Kleen
1 parent 0d9ee6a2d4

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -235,7 +235,7 @@
235 235 int nr;
236 236 do {
237 237 nr = shrink_slab(1000, GFP_KERNEL, 1000);
238   - if (page_count(p) == 0)
  238 + if (page_count(p) == 1)
239 239 break;
240 240 } while (nr > 10);
241 241 }