Thread (78 messages) 78 messages, 7 authors, 2021-08-25
STALE1745d REVIEWED: 1 (0M)
Revisions (4)
  1. rfc [diff vs current]
  2. v1 [diff vs current]
  3. v2 [diff vs current]
  4. v3 current

[PATCH v3 01/14] memory-failure: fetch compound_head after pgmap_pfn_valid()

From: Joao Martins <hidden>
Date: 2021-07-14 19:36:23
Also in: linux-mm, nvdimm
Subsystem: hwpoison memory failure handling, memory management, the rest · Maintainers: Miaohe Lin, Andrew Morton, Linus Torvalds

memory_failure_dev_pagemap() at the moment assumes base pages (e.g.
dax_lock_page()).  For pagemap with compound pages fetch the
compound_head in case a tail page memory failure is being handled.

Currently this is a nop, but in the advent of compound pages in
dev_pagemap it allows memory_failure_dev_pagemap() to keep working.

Reported-by: Jane Chu <redacted>
Signed-off-by: Joao Martins <redacted>
Reviewed-by: Naoya Horiguchi <redacted>
---
 mm/memory-failure.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index eefd823deb67..c40ea28a4677 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1532,6 +1532,12 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags,
 		goto out;
 	}
 
+	/*
+	 * Pages instantiated by device-dax (not filesystem-dax)
+	 * may be compound pages.
+	 */
+	page = compound_head(page);
+
 	/*
 	 * Prevent the inode from being freed while we are interrogating
 	 * the address_space, typically this would be handled by
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help