Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1669360

[PATCH 4.4 23/30] mm/memory-failure.c: use compound_head() flags for huge pages

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.4 23/30] mm/memory-failure.c: use compound_head() flags for huge pages
Date 2017-06-19 17:50 +0200
Message-ID <tU76a-4xl-35@gated-at.bofh.it> (permalink)
References <tU6Wt-4tx-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: James Morse <james.morse@arm.com>

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:

> 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:

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

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

Fixes: 524fca1e7356 ("HWPOISON: fix misjudgement of page_action() for errors on mlocked pages")
Link: http://lkml.kernel.org/r/20170524130204.21845-1-james.morse@arm.com
Signed-off-by: James Morse <james.morse@arm.com>
Tested-by: Punit Agrawal <punit.agrawal@arm.com>
Acked-by: Punit Agrawal <punit.agrawal@arm.com>
Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.4 00/30] 4.4.74-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-19 17:50 +0200
  [PATCH 4.4 23/30] mm/memory-failure.c: use compound_head() flags for huge pages Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-19 17:50 +0200
  [PATCH 4.4 10/30] x86/mm/32: Set the __vmalloc_start_set flag in initmem_init() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-19 17:50 +0200
  [PATCH 4.4 15/30] usb: core: fix potential memory leak in error path during hcd creation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-19 17:50 +0200
  [PATCH 4.4 16/30] [media] pvrusb2: reduce stack usage pvr2_eeprom_analyze() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-19 17:50 +0200
  [PATCH 4.4 06/30] mac80211/wpa: use constant time memory comparison for MACs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-19 17:50 +0200
  [PATCH 4.4 19/30] usb: r8a66597-hcd: decrease timeout Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-19 17:50 +0200
  [PATCH 4.4 25/30] genirq: Release resources in __setup_irq() error path Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-19 17:50 +0200

csiph-web