linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] mm: bad_page() checks bad_flags instead of page->flags for hwpoison page
@ 2016-05-17  7:42 Naoya Horiguchi
  2016-05-18  7:30 ` Vlastimil Babka
  2016-05-18  9:21 ` Mel Gorman
  0 siblings, 2 replies; 9+ messages in thread
From: Naoya Horiguchi @ 2016-05-17  7:42 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Vlastimil Babka, Mel Gorman, linux-mm, linux-kernel,
	Naoya Horiguchi, Naoya Horiguchi

There's a race window between checking page->flags and unpoisoning, which
taints kernel with "BUG: Bad page state". That's overkill. It's safer to
use bad_flags to detect hwpoisoned page.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
---
 mm/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git tmp/mm/page_alloc.c tmp_patched/mm/page_alloc.c
index 5b269bc..4e0fa37 100644
--- tmp/mm/page_alloc.c
+++ tmp_patched/mm/page_alloc.c
@@ -522,8 +522,8 @@ static void bad_page(struct page *page, const char *reason,
 	static unsigned long nr_shown;
 	static unsigned long nr_unshown;
 
-	/* Don't complain about poisoned pages */
-	if (PageHWPoison(page)) {
+	/* Don't complain about hwpoisoned pages */
+	if (bad_flags == __PG_HWPOISON) {
 		page_mapcount_reset(page); /* remove PageBuddy */
 		return;
 	}
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-05-20 14:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-17  7:42 [PATCH v1] mm: bad_page() checks bad_flags instead of page->flags for hwpoison page Naoya Horiguchi
2016-05-18  7:30 ` Vlastimil Babka
2016-05-18  9:21 ` Mel Gorman
2016-05-18  9:31   ` Vlastimil Babka
2016-05-18  9:52     ` Mel Gorman
2016-05-18 10:17       ` Naoya Horiguchi
2016-05-18 10:09     ` [PATCH v2] mm: check_new_page_bad() directly returns in __PG_HWPOISON case Naoya Horiguchi
2016-05-18 14:03       ` Mel Gorman
2016-05-20 14:27         ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).