summaryrefslogtreecommitdiff
path: root/mm/memory-failure.c
diff options
context:
space:
mode:
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>2010-09-08 10:19:36 +0900
committerAndi Kleen <ak@linux.intel.com>2010-10-08 09:32:45 +0200
commit6de2b1aab94355482bd2accdc115666509667458 (patch)
tree630a88dd5afe2c49a428179770140b22bbc9d7da /mm/memory-failure.c
parent290408d4a25002f099efeee7b6a5778d431154d6 (diff)
downloadkernel-mfld-blackbay-6de2b1aab94355482bd2accdc115666509667458.tar.gz
kernel-mfld-blackbay-6de2b1aab94355482bd2accdc115666509667458.tar.bz2
kernel-mfld-blackbay-6de2b1aab94355482bd2accdc115666509667458.zip
HWPOISON, hugetlb: add free check to dequeue_hwpoison_huge_page()
This check is necessary to avoid race between dequeue and allocation, which can cause a free hugepage to be dequeued twice and get kernel unstable. Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Acked-by: Mel Gorman <mel@csn.ul.ie> Reviewed-by: Christoph Lameter <cl@linux.com> Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r--mm/memory-failure.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 757f6b0accf..5c7158a1159 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -698,6 +698,7 @@ static int me_swapcache_clean(struct page *p, unsigned long pfn)
*/
static int me_huge_page(struct page *p, unsigned long pfn)
{
+ int res = 0;
struct page *hpage = compound_head(p);
/*
* We can safely recover from error on free or reserved (i.e.
@@ -710,8 +711,9 @@ static int me_huge_page(struct page *p, unsigned long pfn)
* so there is no race between isolation and mapping/unmapping.
*/
if (!(page_mapping(hpage) || PageAnon(hpage))) {
- __isolate_hwpoisoned_huge_page(hpage);
- return RECOVERED;
+ res = dequeue_hwpoisoned_huge_page(hpage);
+ if (!res)
+ return RECOVERED;
}
return DELAYED;
}