linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Boone, Max" <mboone@akamai.com>
To: Qi Zheng <qi.zheng@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] mm/pagewalk: fix race between concurrent split and refault
Date: Wed, 18 Mar 2026 07:37:40 +0000	[thread overview]
Message-ID: <AA2CFF2E-F3DC-4EE7-AE69-5FAF1CFE39E4@akamai.com> (raw)
In-Reply-To: <268abf39-9cd6-412e-b3ec-32fb8fea1684@linux.dev>

[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]

Hey Qi,

[…]

> 
> Why not check pudval directly here? Like the following:
> 
> if (pud_leaf(*pud) || !pud_present(*pud))
> goto again;
> 

Good point, my initial idea [1] was also to put it there (although I
checked on pud_special instead and continued instead of retrying).
I wasn’t sure whether I could link to a thread in a patch message,
but there’s some discussion between David and me there.

Making sure that a passed-in PMD range can be walked by checking 
if the parent PUD is present & not a leaf feels better suited as a guard
in the walk_pmd_range() function to me. After all, the failure originates
from inside that function, and potential other callers won’t need to 
incorporate the check which has to be done for safety anyways.

It also makes the logic of walk_pud_range() more similar to 
walk_pmd_range() - which also has the retry if it gets an ACTION_AGAIN
from the walk_pte_range() call.

Finally, doesn’t feel very natural to me to have:

if (walk->vma)
    split_huge_pud(walk->vma, pud, addr);
else if (pud_leaf(*pud) || !pud_present(*pud))
    continue; /* Nothing to do. */
if (pud_leaf(*pud) || !pud_present(*pud))
    goto again; /* Retry on concurrent refault as leaf */

[1] https://lore.kernel.org/all/20260309174949.2514565-1-mboone@akamai.com/

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 3061 bytes --]

  reply	other threads:[~2026-03-18  7:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17 14:03 Max Boone via B4 Relay
2026-03-17 14:05 ` David Hildenbrand (Arm)
2026-03-18  6:16 ` Qi Zheng
2026-03-18  7:37   ` Boone, Max [this message]
2026-03-18  7:38   ` David Hildenbrand (Arm)
2026-03-18 12:55 ` Lorenzo Stoakes (Oracle)
2026-03-18 13:08   ` Boone, Max
2026-03-18 13:27     ` Boone, Max
2026-03-18 14:07       ` Lorenzo Stoakes (Oracle)
2026-03-18 14:10     ` Lorenzo Stoakes (Oracle)
2026-03-18 14:30       ` 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=AA2CFF2E-F3DC-4EE7-AE69-5FAF1CFE39E4@akamai.com \
    --to=mboone@akamai.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=qi.zheng@linux.dev \
    --cc=rppt@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=surenb@google.com \
    --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