Skip to content

Commit

Permalink
HWPOISON: Stop shrinking at right page count
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andi Kleen committed Oct 7, 2010
1 parent 0d9ee6a commit 47f43e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 47f43e7

Please sign in to comment.