hwpoison, hugetlbfs: fix "bad pmd" warning in unmapping hwpoisoned hugepage
authorNaoya Horiguchi <[email protected]>
Wed, 12 Dec 2012 21:52:28 +0000 (13:52 -0800)
committerLinus Torvalds <[email protected]>
Thu, 13 Dec 2012 01:38:35 +0000 (17:38 -0800)
When a process which used a hwpoisoned hugepage tries to exit() or
munmap(), the kernel can print out "bad pmd" message because page table
walker in free_pgtables() encounters 'hwpoisoned entry' on pmd.

This is because currently we fail to clear the hwpoisoned entry in
__unmap_hugepage_range(), so this patch simply does it.

Signed-off-by: Naoya Horiguchi <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Wu Fengguang <[email protected]>
Cc: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/hugetlb.c

index bd22bd895299c7b39edd88879dc8e3f508a00193..e53f39cd67dba964cc9c651d32d82e55e32f5377 100644 (file)
@@ -2386,8 +2386,10 @@ again:
                /*
                 * HWPoisoned hugepage is already unmapped and dropped reference
                 */
-               if (unlikely(is_hugetlb_entry_hwpoisoned(pte)))
+               if (unlikely(is_hugetlb_entry_hwpoisoned(pte))) {
+                       pte_clear(mm, address, ptep);
                        continue;
+               }
 
                page = pte_page(pte);
                /*