Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Zhenwen Liang <zhenwenliang@google.com>, Zi Yan <ziy@nvidia.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	 "Liam R. Howlett" <liam@infradead.org>,
	Nico Pache <nico.pache@linux.dev>,
	 Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>,
	 Lance Yang <lance.yang@linux.dev>,
	Usama Arif <usama.arif@linux.dev>,
	 Kiryl Shutsemau <kas@kernel.org>,
	linux-mm@kvack.org, Vlastimil Babka <vbabka@kernel.org>,
	 Mike Rapoport <rppt@kernel.org>, Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH v3] mm/huge_memory: order the MMF_HUGE_ZERO_FOLIO test before the huge_zero_folio load
Date: Mon, 30 Nov 2026 16:50:14 +0000	[thread overview]
Message-ID: <aw2pGNHhf7v0Odps@gremlin> (raw)
In-Reply-To: <3914f4ac-6985-4ec2-abe7-1c4d2d4d8c1d@kernel.org>

On Mon, Nov 30, 2026 at 05:48:31PM +0100, David Hildenbrand (Arm) wrote:
> On 11/30/26 17:06, Lorenzo Stoakes (ARM) wrote:
> > On Mon, Nov 30, 2026 at 12:53:01PM +0000, Zhenwen Liang wrote:
> >> With CONFIG_PERSISTENT_HUGE_ZERO_FOLIO=n, mm_get_huge_zero_folio() tests
> >> MMF_HUGE_ZERO_FOLIO with a plain test_bit() and then loads
> >> huge_zero_folio, ordered only by a control dependency. A reader can see
> >> the flag set by another thread of the same mm and still load NULL; the
> >> fault then falls back to a normal page. Add mm_flags_test_acquire() and
> >> use it for this test; it pairs with the full barrier of
> >> mm_flags_test_and_set().
> >>
> >> Compile-tested only.
> >>
> >> The problem was found, and this patch prepared, with the help of a
> >> formal analysis tool we are developing that uses AI assistance; I have
> >> reviewed the analysis and the patch.
> >>
> >> Fixes: 6fcb52a56ff6 ("thp: reduce usage of huge zero page's atomic counter")
> >> Cc: Lorenzo Stoakes <ljs@kernel.org>
> >> Signed-off-by: Zhenwen Liang <zhenwenliang@google.com>
> >
> > Little annoyed to have wasted my time replying to v2 only to see there's a v3
> > already, and also already taken, but anyway.
>
> As my length comment in there spells out: this can be yanked every time. I
> applied it before spotting your comment on v2.
>
> So let' please have a v4 if stuff here needs more changes, and I'll apply that
> one instead.

Sorry I'm extra-grumpy today... :)

I thought you would be reticent to for stable commit hash reasons? I guess you
can keep the commit hash but still change things like add tags though? Or no?

--
Cheers, Lorenzo


  reply	other threads:[~2026-11-30 16:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 12:53 [PATCH v3] mm/huge_memory: order the MMF_HUGE_ZERO_FOLIO test before the huge_zero_folio load Zhenwen Liang
2026-11-30 15:11 ` Zi Yan
2026-11-30 15:33 ` David Hildenbrand (Arm)
2026-11-30 15:34 ` David Hildenbrand
2026-11-30 16:06 ` Lorenzo Stoakes (ARM)
2026-11-30 16:22   ` Zi Yan
2026-11-30 16:46     ` Lorenzo Stoakes (ARM)
2026-11-30 16:32   ` Zhenwen Liang
2026-11-30 16:46     ` Lorenzo Stoakes (ARM)
2026-11-30 16:48   ` David Hildenbrand (Arm)
2026-11-30 16:50     ` Lorenzo Stoakes (ARM) [this message]
2026-11-30 16:51       ` Lorenzo Stoakes (ARM)
2026-11-30 16:56       ` 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=aw2pGNHhf7v0Odps@gremlin \
    --to=ljs@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=kas@kernel.org \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=nico.pache@linux.dev \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=usama.arif@linux.dev \
    --cc=vbabka@kernel.org \
    --cc=zhenwenliang@google.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