From abed3733868ce4ab19c29ed36ac321129766229c Mon Sep 17 00:00:00 2001 From: Wu Fengguang Date: Wed, 16 Dec 2009 12:19:57 +0100 Subject: [PATCH] --- yaml --- r: 177615 b: refs/heads/master c: bd1ce5f91f545730df4af492f774d9d32f5da3cb h: refs/heads/master i: 177613: 234ae430035329797234b84e1daf8c665a8c5ab0 177611: d0396743288daa645e1cffafdc8759ac005ee71c 177607: 756bcef4a363133ee4ab403af8d01da7745985c8 177599: a787d4407f9d6bbeed578978633af563ef22250d v: v3 --- [refs] | 2 +- trunk/mm/madvise.c | 1 - trunk/mm/memory-failure.c | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 3d79eedb4a04..69eb9a0d5e63 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a7560fc80f33cab33176ee78f146df22b28e3338 +refs/heads/master: bd1ce5f91f545730df4af492f774d9d32f5da3cb diff --git a/trunk/mm/madvise.c b/trunk/mm/madvise.c index 35b1479b7c9d..18970aec0d2f 100644 --- a/trunk/mm/madvise.c +++ b/trunk/mm/madvise.c @@ -238,7 +238,6 @@ static int madvise_hwpoison(unsigned long start, unsigned long end) page_to_pfn(p), start); /* Ignore return value for now */ __memory_failure(page_to_pfn(p), 0, 1); - put_page(p); } return ret; } diff --git a/trunk/mm/memory-failure.c b/trunk/mm/memory-failure.c index 275f4e2df8ac..4253e14fa709 100644 --- a/trunk/mm/memory-failure.c +++ b/trunk/mm/memory-failure.c @@ -627,7 +627,7 @@ static void action_result(unsigned long pfn, char *msg, int result) } static int page_action(struct page_state *ps, struct page *p, - unsigned long pfn, int ref) + unsigned long pfn) { int result; int count; @@ -635,7 +635,7 @@ static int page_action(struct page_state *ps, struct page *p, result = ps->action(p, pfn); action_result(pfn, ps->msg, result); - count = page_count(p) - 1 - ref; + count = page_count(p) - 1; if (count != 0) printk(KERN_ERR "MCE %#lx: %s page still referenced by %d users\n", @@ -773,7 +773,7 @@ int __memory_failure(unsigned long pfn, int trapno, int ref) * In fact it's dangerous to directly bump up page count from 0, * that may make page_freeze_refs()/page_unfreeze_refs() mismatch. */ - if (!get_page_unless_zero(compound_head(p))) { + if (!ref && !get_page_unless_zero(compound_head(p))) { action_result(pfn, "free or high order kernel", IGNORED); return PageBuddy(compound_head(p)) ? 0 : -EBUSY; } @@ -821,7 +821,7 @@ int __memory_failure(unsigned long pfn, int trapno, int ref) res = -EBUSY; for (ps = error_states;; ps++) { if (((p->flags | lru_flag)& ps->mask) == ps->res) { - res = page_action(ps, p, pfn, ref); + res = page_action(ps, p, pfn); break; } }