All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-memory-failure-fix-race-with-compound-page-split-merge.patch added to -mm tree
@ 2016-04-21 23:45 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-04-21 23:45 UTC (permalink / raw)
  To: khlebnikov, n-horiguchi, mm-commits


The patch titled
     Subject: mm/memory-failure: fix race with compound page split/merge
has been added to the -mm tree.  Its filename is
     mm-memory-failure-fix-race-with-compound-page-split-merge.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-memory-failure-fix-race-with-compound-page-split-merge.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-memory-failure-fix-race-with-compound-page-split-merge.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Subject: mm/memory-failure: fix race with compound page split/merge

Get_hwpoison_page() must recheck relation between head and tail pages.

n-horiguchi said: without this recheck, the race causes kernel to pin an
irrelevant page, and finally makes kernel crash for refcount mismatch.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memory-failure.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff -puN mm/memory-failure.c~mm-memory-failure-fix-race-with-compound-page-split-merge mm/memory-failure.c
--- a/mm/memory-failure.c~mm-memory-failure-fix-race-with-compound-page-split-merge
+++ a/mm/memory-failure.c
@@ -888,7 +888,15 @@ int get_hwpoison_page(struct page *page)
 		}
 	}
 
-	return get_page_unless_zero(head);
+	if (get_page_unless_zero(head)) {
+		if (head == compound_head(page))
+			return 1;
+
+		pr_info("MCE: %#lx cannot catch tail\n", page_to_pfn(page));
+		put_page(head);
+	}
+
+	return 0;
 }
 EXPORT_SYMBOL_GPL(get_hwpoison_page);
 
_

Patches currently in -mm which might be from khlebnikov@yandex-team.ru are

mm-memory-failure-fix-race-with-compound-page-split-merge.patch
mm-rmap-replace-bug_onanon_vma-degree-with-vm_warn_on.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-21 23:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-21 23:45 + mm-memory-failure-fix-race-with-compound-page-split-merge.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.