Skip to contentSkip to conversation

Patch "mm/memory-failure.c: use compound_head() flags for huge pages" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Jun 18, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

mm/memory-failure.c: use compound_head() flags for huge pages

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
mm-memory-failure.c-use-compound_head-flags-for-huge-pages.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 7258ae5c5a2ce2f5969e8b18b881be40ab55433d Mon Sep 17 00:00:00 2001

From: James Morse <[email protected]>
Date: Fri, 16 Jun 2017 14:02:29 -0700
Subject: mm/memory-failure.c: use compound_head() flags for huge pages

From: James Morse <[email protected]>

commit 7258ae5c5a2ce2f5969e8b18b881be40ab55433d upstream.

memory_failure() chooses a recovery action function based on the page flags. For huge pages it uses the tail page flags which don't have anything interesting set, resulting in:

Quoted 2 lines

Memory failure: 0x9be3b4: Unknown page state
Memory failure: 0x9be3b4: recovery action for unknown page: Failed

Instead, save a copy of the head page's flags if this is a huge page, this means if there are no relevant flags for this tail page, we use the head pages flags instead. This results in the me_huge_page() recovery action being called:

Quoted 1 line

Memory failure: 0x9b7969: recovery action for huge page: Delayed

For hugepages that have not yet been allocated, this allows the hugepage to be dequeued.

---
 mm/memory-failure.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
mm/memory-failure.c +4 -1
@@ -1208,7 +1208,10 @@ int memory_failure(unsigned long pfn, in
 	 * page_remove_rmap() in try_to_unmap_one(). So to determine page status
 	 * correctly, we save a copy of the page flags at this time.
 	 */
-	page_flags = p->flags;
+	if (PageHuge(p))
+		page_flags = hpage->flags;
+	else
+		page_flags = p->flags;
 
 	/*
 	 * unpoison always clear PG_hwpoison inside page lock

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/mm-memory-failure.c-use-compound_head-flags-for-huge-pages.patch