linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hwpoison: Check the subpage, not the head page
@ 2022-01-30  1:30 Matthew Wilcox (Oracle)
  2022-01-30 20:58 ` David Rientjes
  2022-02-01 18:29 ` Yang Shi
  0 siblings, 2 replies; 8+ messages in thread
From: Matthew Wilcox (Oracle) @ 2022-01-30  1:30 UTC (permalink / raw)
  To: Andrew Morton, linux-mm, linux-kernel, Naoya Horiguchi
  Cc: Matthew Wilcox (Oracle)

Hardware poison is tracked on a per-page basis, not on the head page.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/rmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 6a1e8c7f6213..09b08888120e 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1553,7 +1553,7 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
 		/* Update high watermark before we lower rss */
 		update_hiwater_rss(mm);
 
-		if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) {
+		if (PageHWPoison(subpage) && !(flags & TTU_IGNORE_HWPOISON)) {
 			pteval = swp_entry_to_pte(make_hwpoison_entry(subpage));
 			if (PageHuge(page)) {
 				hugetlb_count_sub(compound_nr(page), mm);
@@ -1873,7 +1873,7 @@ static bool try_to_migrate_one(struct page *page, struct vm_area_struct *vma,
 			 * memory are supported.
 			 */
 			subpage = page;
-		} else if (PageHWPoison(page)) {
+		} else if (PageHWPoison(subpage)) {
 			pteval = swp_entry_to_pte(make_hwpoison_entry(subpage));
 			if (PageHuge(page)) {
 				hugetlb_count_sub(compound_nr(page), mm);
-- 
2.34.1



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

end of thread, other threads:[~2022-02-01 18:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-30  1:30 [PATCH] mm/hwpoison: Check the subpage, not the head page Matthew Wilcox (Oracle)
2022-01-30 20:58 ` David Rientjes
2022-01-30 21:14   ` Matthew Wilcox
2022-01-31  5:44     ` HORIGUCHI NAOYA(堀口 直也)
2022-01-31 13:24       ` Matthew Wilcox
2022-01-31 19:24         ` Mike Kravetz
2022-01-31 23:04           ` HORIGUCHI NAOYA(堀口 直也)
2022-02-01 18:29 ` Yang Shi

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).