提交 47f43e7e 编写于 作者: A Andi Kleen

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: NWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: NAndi Kleen <ak@linux.intel.com>
上级 0d9ee6a2
...@@ -235,7 +235,7 @@ void shake_page(struct page *p, int access) ...@@ -235,7 +235,7 @@ void shake_page(struct page *p, int access)
int nr; int nr;
do { do {
nr = shrink_slab(1000, GFP_KERNEL, 1000); nr = shrink_slab(1000, GFP_KERNEL, 1000);
if (page_count(p) == 0) if (page_count(p) == 1)
break; break;
} while (nr > 10); } while (nr > 10);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册