From: Mani Tofigh <mt4022@columbia.edu>
To: "David Hildenbrand (Arm)" <david@kernel.org>,
Oscar Salvador <osalvador@suse.de>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>,
Naoya Horiguchi <nao.horiguchi@gmail.com>,
Vlastimil Babka <vbabka@kernel.org>,
Gregory Price <gourry@gourry.net>,
linux-mm@kvack.org, linux-cxl@vger.kernel.org,
linux-kernel@vger.kernel.org, tz2294@columbia.edu,
stable@vger.kernel.org
Subject: Re: [PATCH] mm/memory_hotplug: don't offline a hwpoisoned page still in the page cache
Date: Tue, 3 Nov 2026 14:59:02 -0500 [thread overview]
Message-ID: <a002901b-715a-4adc-bdcb-7a6fcda67711@columbia.edu> (raw)
In-Reply-To: <1b6a6d13-8a01-414b-9bbe-cd194af1f539@kernel.org>
On 11/2/26 1:56 AM, David Hildenbrand (Arm) wrote:
>
> What if we still have the page pinned somehow? (vmscplice etc).
>
> Wouldn't it be better to make sure that poisoning code holds exactly one
> reference (whoever set hwpoison) and check here that the refcount is 1 ?
>
> Pagecache references would turn it > 1.
Yes right, a pin isn't covered (neither before nor with this patch).
I don't think refcount == 1 can replace the mapping check though. In the
race from the changelog memory_failure() has set PG_hwpoison but is
still waiting in get_hwpoison_page(), so it doesn't hold its reference
yet, and a clean page-cache folio then has just the one reference from
the page cache. memory_failure() also doesn't take a reference on the
kernel pages it ignores, and a poisoned page that gets freed later sits
at 0.
So I'd keep the mapping check and add "refcount <= 1" on top as a
follow-up, since that also needs do_migrate_range() to drop the
reference it takes when it takes a poisoned folio off the LRU. Does that
sound good?
I'll send a v2 soon with a small do_migrate_range() change from the
bot's review.
Mani
next prev parent reply other threads:[~2026-11-03 19:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 19:40 Mani Tofigh via B4 Relay
2026-11-02 6:56 ` David Hildenbrand (Arm)
2026-11-03 19:59 ` Mani Tofigh [this message]
2026-11-07 19:41 ` David Hildenbrand (Arm)
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=a002901b-715a-4adc-bdcb-7a6fcda67711@columbia.edu \
--to=mt4022@columbia.edu \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=gourry@gourry.net \
--cc=linmiaohe@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nao.horiguchi@gmail.com \
--cc=osalvador@suse.de \
--cc=stable@vger.kernel.org \
--cc=tz2294@columbia.edu \
--cc=vbabka@kernel.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®