Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Mani Tofigh <mt4022@columbia.edu>,
	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 v2] mm/memory_hotplug: don't offline a hwpoisoned page still in the page cache
Date: Mon, 23 Nov 2026 20:45:37 +0100	[thread overview]
Message-ID: <89037847-8875-4d8b-a8f3-d77a59aaddea@kernel.org> (raw)
In-Reply-To: <2e11ba52-b5c6-463e-a5ea-c165ba935704@columbia.edu>

On 11/23/26 06:46, Mani Tofigh wrote:
> 
> 
> On 11/6/26 3:58 PM, David Hildenbrand (Arm) wrote:
>> I didn't understand why just checking for the refcount is not sufficient. Can
>> you elaborate once more (and please not send a new revision before the
>> discussion is over).
>>
>> Memory poisoning must grab a reference when setting the folio hwpoison. Any
>> other reference (pin, pagecache, swapcache, mapping) keeps it alive.
>>
>> Why can't we build on and?
> 
> 
> Right, but memory_failure() doesn't always hold that reference. It i)
> sets the flag before get_hwpoison_page() grabs it, which waits on
> pcp_batch_high_lock that offline_pages() holds, and ii) gives up with 
> the flag set and no reference when get_hwpoison_page() fails (e.g.,
> a pagecache folio briefly off the LRU). In both cases the pagecache
> holds the only reference, so offline can't tell it apart from a
> page memory_failure() already handled.
> 
> So I think if we move zone_pcp_disable() in memory_failure() before
> setting the flag and keep the reference when it gives up, offline could
> simply treat any poisoned page with refcount > 1 as busy. That'd cover
> pins too. What do you think?

We'll have to find a way to make that reliable. Everything else is just hacking
around it.

Why can we block concurrent offlining through get_online_mems/put_online_mems?
But I hate these functions.

Or alternatively (better?), have a memory notifier that block concurrent
memory_failure() by grabbing the mf_mutex when MEM_GOING_OFFLINE and releasing
it when MEM_CANCEL_OFFLINE/MEM_OFFLINE.

Needs some thought, but if the problem is that these two mechanisms don't
interact well concurrently, then we should make them mutually exclusive.

-- 
Cheers,

David

  reply	other threads:[~2026-11-23 19:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 20:50 [PATCH v2] mm/memory_hotplug: don't offline a hwpoisoned page still in the page cache Mani Tofigh via B4 Relay
2026-11-06 20:58 ` David Hildenbrand (Arm)
2026-11-23  5:46   ` Mani Tofigh
2026-11-23 19:45     ` David Hildenbrand (Arm) [this message]
2026-11-23 12:29 ` Miaohe Lin

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=89037847-8875-4d8b-a8f3-d77a59aaddea@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.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=mt4022@columbia.edu \
    --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