Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>,
	William Roche <william.roche@oracle.com>,
	Jiaqi Yan <jiaqiyan@google.com>,
	linmiaohe@huawei.com, ljs@kernel.org, ziy@nvidia.com,
	osalvador@kernel.org, harry.yoo@oracle.com, osalvador@suse.de,
	jackmanb@google.com, hannes@cmpxchg.org, nao.horiguchi@gmail.com,
	tony.luck@intel.com, wangkefeng.wang@huawei.com,
	jane.chu@oracle.com, akpm@linux-foundation.org,
	muchun.song@linux.dev, liam@infradead.org, rientjes@google.com,
	duenwen@google.com, jthoughton@google.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, rppt@kernel.org, shuah@kernel.org,
	surenb@google.com, mhocko@suse.com, boudewijn@delta-utec.com
Subject: Re: [PATCH v6 0/5] Only free healthy pages in high-order has_hwpoisoned folio
Date: Mon, 27 Jul 2026 19:20:50 +0100	[thread overview]
Message-ID: <amehgk7iUTL3Cow6@casper.infradead.org> (raw)
In-Reply-To: <168ad406-f6b5-4623-adac-9f894e410e48@kernel.org>

On Mon, Jul 27, 2026 at 04:20:54PM +0200, David Hildenbrand (Arm) wrote:
> >> Just adding a comment about this aspect:
> >> The check_new_pages() mechanism used by the __rmqueue functions should
> >> filter these pages out, but this has been disabled by default in 2023
> >> with:
> >> [PATCH] mm, page_alloc: reduce page alloc/free sanity checks
> >> https://lore.kernel.org/all/20230216095131.17336-1-vbabka@suse.cz
> >>
> >> So it would need to be enabled back, taking some of the performance hit.
> >> (and I personally think that it has to be done)
> > 
> > Would it truly fix the issue, or rather there would still be a race window
> > left where we check that there's no hwpoison flag in the re-enabled check,
> > and only then someone sets it?
> 
> Why are we checking PageHWPoison at all then in check_new_page()?
> 
> I think we created a mess.
> 
> The PageHWPoison check is not just a "nice to have" sanity check for kernel bugs.
> 
> So it should never have been optimized out that way before reworking the bigger
> picture.

There's A Lot Going On (and I don't think I understand it all yet).
We can soft-poison pages while they're in Buddy, for example.
And then soft-unpoison them again.  Is it handled properly?  I doubt
it.  Looks to me like it's full of races.

> > Also, can the hardware actually detect a problem with a page that nobody
> > accesses? I guess if yes, it's only in some corner cases.
> 
> Yes, quite frequently I think.
> 
> > 
> > So I'm wary about penalizing the allocator paths again.
> 
> I get the feeling that we don't have a proper plan on how to handle HWPoisoned
> pages. We should take a step back and discuss how we actually want to handle
> them instead of optimizing here and there and creating more of a mess.

I feel like there's a general lack of understanding of how hwpoison
works amongst those of us who work on the core of memory handling,
and the memory-failure code has not been kept up to date with how we
think about page/folio/memdesc handling.  It might be good to have a
BOF at Plumbers to share our (mis)understandings of how all of this
works yesterday/today/tomorrow.


  reply	other threads:[~2026-07-27 18:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-05 18:07 [PATCH v6 0/5] Only free healthy pages in high-order has_hwpoisoned folio Jiaqi Yan
2026-07-05 18:07 ` [PATCH v6 1/5] mm/page_alloc: introduce __free_prepared_contig_range() with fpi_t Jiaqi Yan
2026-07-17  7:17   ` Miaohe Lin
2026-07-22  9:38   ` Vlastimil Babka (SUSE)
2026-07-25  3:54   ` Matthew Wilcox
2026-07-05 18:07 ` [PATCH v6 2/5] mm/page_alloc: only free healthy pages in high-order has_hwpoisoned folio Jiaqi Yan
2026-07-17  7:19   ` Miaohe Lin
2026-07-22  9:40   ` Vlastimil Babka (SUSE)
2026-07-05 18:07 ` [PATCH v6 3/5] mm/memory-failure: set has_hwpoisoned flags on dissolved HugeTLB folio Jiaqi Yan
2026-07-25  3:05   ` Jiaqi Yan
2026-07-05 18:07 ` [PATCH v6 4/5] mm/memory-failure: skip take_page_off_buddy after dissolving HWPoison HugeTLB page Jiaqi Yan
2026-07-05 18:07 ` [PATCH v6 5/5] selftests/mm: add hard memory failure anonymous HugeTLB test Jiaqi Yan
2026-07-25  3:05   ` Jiaqi Yan
2026-07-05 18:50 ` [PATCH v6 0/5] Only free healthy pages in high-order has_hwpoisoned folio Andrew Morton
2026-07-06  9:03   ` David Hildenbrand (Arm)
2026-07-25  3:06   ` Jiaqi Yan
     [not found] ` <85cb7ea8-8116-4092-8310-69b61eb8602c@kernel.org>
     [not found]   ` <ee6bcc74-0846-43f2-bcca-b1bedff74351@oracle.com>
2026-07-22  8:27     ` Vlastimil Babka (SUSE)
2026-07-22  9:03       ` Vlastimil Babka (SUSE)
2026-07-25  6:00         ` Jiaqi Yan
2026-07-25  6:52       ` Jiaqi Yan
2026-07-27 14:20       ` David Hildenbrand (Arm)
2026-07-27 18:20         ` Matthew Wilcox [this message]
2026-07-28 17:18         ` Vlastimil Babka (SUSE)
2026-08-04 19:51           ` David Hildenbrand (Arm)
2026-08-05  8:58             ` Vlastimil Babka (SUSE)
2026-08-05  9:09               ` 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=amehgk7iUTL3Cow6@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=boudewijn@delta-utec.com \
    --cc=david@kernel.org \
    --cc=duenwen@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=harry.yoo@oracle.com \
    --cc=jackmanb@google.com \
    --cc=jane.chu@oracle.com \
    --cc=jiaqiyan@google.com \
    --cc=jthoughton@google.com \
    --cc=liam@infradead.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=nao.horiguchi@gmail.com \
    --cc=osalvador@kernel.org \
    --cc=osalvador@suse.de \
    --cc=rientjes@google.com \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=tony.luck@intel.com \
    --cc=vbabka@kernel.org \
    --cc=wangkefeng.wang@huawei.com \
    --cc=william.roche@oracle.com \
    --cc=ziy@nvidia.com \
    /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