From: Miaohe Lin <linmiaohe@huawei.com>
To: Mani Tofigh <mt4022@columbia.edu>
Cc: David Hildenbrand <david@kernel.org>,
Naoya Horiguchi <nao.horiguchi@gmail.com>,
Kiryl Shutsemau <kas@kernel.org>, Mike Rapoport <rppt@kernel.org>,
Mike Kravetz <mike.kravetz@oracle.com>,
Matthew Wilcox <willy@infradead.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>, <tz2294@columbia.edu>,
<stable@vger.kernel.org>, Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v3] mm/memory-failure: set PG_hwpoison of a non-hugetlb page under hugetlb_lock
Date: Mon, 23 Nov 2026 15:26:48 +0800 [thread overview]
Message-ID: <77680005-7178-cb1d-6e20-e23519839222@huawei.com> (raw)
In-Reply-To: <08b18b88-3ab4-4681-bec8-f4564fe9f1dc@columbia.edu>
On 2026/11/23 14:19, Mani Tofigh wrote:
>
>
> On 11/17/26 2:01 AM, Miaohe Lin wrote:
>> In both cases, will the hwpoison flag be lost? If so, would TestClearPageHWPoison work?
>
> Only if P's struct page is past the first vmemmap page, since HVO frees
If P's struct page is past the first vmemmap page, the hwpoison flag is lost. In this case,
do we need to do something? Now that hwpoison flag is already lost, I don't think so. And
TestClearPageHWPoison won't do anything in this case. Or do you mean TestClearPageHWPoison
will always write even if hwpoison flag is not set? If so, can test + clear do the work?
> that one. In the first page it's copied, so the flag stays. And
In the first page, the hwpoison flag stays. So TestClearPageHWPoison can do the right thing here?
> TestClearPageHWPoison() is still an atomic write, so it'd fault on the> read-only tail (e.g., 6.6) the same way.
>
>
>> If the page becomes hugetlb, should we skip the retry path? try_memory_failure_hugetlb
>> can't handle this case?
>>
>
>
> It can, the only problem is the stale flag from the first round. With it, hugetlb_update_hwpoison() thinks the folio is already poisoned if
> P is the head, and unpoison_memory() drops the folio ref twice if
> P is a tail.
I think we can correctly clear the stale flag from the first round.
Am I miss something?
Thanks.
.
prev parent reply other threads:[~2026-11-23 7:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 16:09 Mani Tofigh via B4 Relay
2026-11-06 22:39 ` Andrew Morton
2026-11-09 11:29 ` Miaohe Lin
2026-11-09 7:23 ` Miaohe Lin
2026-11-11 23:21 ` Mani Tofigh
2026-11-17 7:01 ` Miaohe Lin
2026-11-23 6:19 ` Mani Tofigh
2026-11-23 7:26 ` Miaohe Lin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=77680005-7178-cb1d-6e20-e23519839222@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=kas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=mt4022@columbia.edu \
--cc=muchun.song@linux.dev \
--cc=nao.horiguchi@gmail.com \
--cc=osalvador@suse.de \
--cc=rppt@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tz2294@columbia.edu \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®