From patchwork Sun Jan 30 01:30:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 12729715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAA71C433EF for ; Sun, 30 Jan 2022 01:30:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CFE986B0071; Sat, 29 Jan 2022 20:30:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CAD866B0074; Sat, 29 Jan 2022 20:30:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B74CD6B0075; Sat, 29 Jan 2022 20:30:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0197.hostedemail.com [216.40.44.197]) by kanga.kvack.org (Postfix) with ESMTP id A563C6B0071 for ; Sat, 29 Jan 2022 20:30:53 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 665F7998C6 for ; Sun, 30 Jan 2022 01:30:53 +0000 (UTC) X-FDA: 79085224386.31.BB92A96 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf09.hostedemail.com (Postfix) with ESMTP id 4C9E8140002 for ; Sun, 30 Jan 2022 01:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=sNo+q8NP0g/grRrgvaQU0GQNcAFAxbTtuvdhfsfCaOo=; b=Ixgofnqh7NphtJFc6w+tKbAawE HIqukir/pirZwWe/M9f/Ovzyy2mlYlw9/5vCsQkP1pOFC8ctVhRembbgaD4D4XbBQdxOxcDv7PZHq d/R8J/UOxj06DjP1EUsWr+s3ckzSyvP9PJj8IfKh7lrr49rupS6hDxEUnky3vLfMVraSm83A+QFeZ mmnRrEWuwBk3g3EJaATT9UZXc/mZxqE71HvL6f3jsNeL4y0wM2DpDBS/qF/MRjvnV3iYgGkU9G/nl 1TAnmj9wSSG2cp95VduIacm6PQ3Ex5jnlFp3rXfMpqJodJIXmOmV4I8RtlbrR1R1nm/qN+hNGky6e rv03D58Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDz3E-0080Ep-Oe; Sun, 30 Jan 2022 01:30:44 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Naoya Horiguchi Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH] mm/hwpoison: Check the subpage, not the head page Date: Sun, 30 Jan 2022 01:30:42 +0000 Message-Id: <20220130013042.1906881-1-willy@infradead.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 4C9E8140002 X-Stat-Signature: medxwxj11gcbhjkshiwroortswm3t7ra X-Rspam-User: nil Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Ixgofnqh; spf=none (imf09.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1643506252-367405 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hardware poison is tracked on a per-page basis, not on the head page. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Naoya Horiguchi --- 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);