aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorHugh Dickins <hugh.dickins@tiscali.co.uk>2009-10-26 19:49:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-10-29 10:39:24 -0400
commit92f7ba70eecf4da8264a767b181cc2090f62d4ad (patch)
treec8e0fe4239efcf114a01896e3836b30cddf0ba1b /mm
parent2eca40a8ccd4160dbfaa5cbd61038d921d0e5f13 (diff)
hwpoison: fix oops on ksm pages
Memory failure on a KSM page currently oopses on its NULL anon_vma in page_lock_anon_vma(): that may not be much worse than the consequence of ignoring it, but it is better to be consistent with how ZERO_PAGE and hugetlb pages and other awkward cases are treated. Just skip it. We could fix it for 2.6.32 at the KSM end, by putting a dummy anon_vma pointer in there; but that would get harder next time, when KSM will put a pointer to something else there (and I'm not currently planning to do any work to open that up to memory_failure). So I would prefer this simple PageKsm test, until the other exceptions are handled. Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk> Cc: Andi Kleen <andi@firstfloor.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory-failure.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 729d4b15b645..7fc2130d2737 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -35,6 +35,7 @@
35#include <linux/mm.h> 35#include <linux/mm.h>
36#include <linux/page-flags.h> 36#include <linux/page-flags.h>
37#include <linux/sched.h> 37#include <linux/sched.h>
38#include <linux/ksm.h>
38#include <linux/rmap.h> 39#include <linux/rmap.h>
39#include <linux/pagemap.h> 40#include <linux/pagemap.h>
40#include <linux/swap.h> 41#include <linux/swap.h>
@@ -661,7 +662,7 @@ static void hwpoison_user_mappings(struct page *p, unsigned long pfn,
661 int i; 662 int i;
662 int kill = 1; 663 int kill = 1;
663 664
664 if (PageReserved(p) || PageCompound(p) || PageSlab(p)) 665 if (PageReserved(p) || PageCompound(p) || PageSlab(p) || PageKsm(p))
665 return; 666 return;
666 667
667 if (!PageLRU(p)) 668 if (!PageLRU(p))