From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Dev Jain <dev.jain@arm.com>, linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/dirty: Replace READ_ONCE() with pudp_get()
Date: Mon, 6 Oct 2025 11:58:20 +0530 [thread overview]
Message-ID: <1c948262-e201-4473-b156-8b90fedc9ce7@arm.com> (raw)
In-Reply-To: <4b513d32-7795-4998-98df-d398c3d5462a@arm.com>
On 06/10/25 11:37 AM, Dev Jain wrote:
>
> On 06/10/25 11:22 am, Anshuman Khandual wrote:
>> Replace READ_ONCE() with a standard page table accessor i.e pudp_get() that
>> anyways defaults into READ_ONCE() in cases where platform does not override
>>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: David Hildenbrand <david@redhat.com>
>> Cc: linux-mm@kvack.org
>> Cc: linux-kernel@vger.kernel.org
>> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
>> ---
>> mm/mapping_dirty_helpers.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/mapping_dirty_helpers.c b/mm/mapping_dirty_helpers.c
>> index c193de6cb23a..737c407f4081 100644
>> --- a/mm/mapping_dirty_helpers.c
>> +++ b/mm/mapping_dirty_helpers.c
>> @@ -149,7 +149,7 @@ static int wp_clean_pud_entry(pud_t *pud, unsigned long addr, unsigned long end,
>> struct mm_walk *walk)
>> {
>> #ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
>> - pud_t pudval = READ_ONCE(*pud);
>> + pud_t pudval = pudp_get(pud);
>> /* Do not split a huge pud */
>> if (pud_trans_huge(pudval)) {
>
> Talking about mm, why not also make changes for these READ_ONCE accesses
> in gup, hmm, memory, mprotect, sparse-vmemmap?
>
Right, could replace all mm/ READ_ONCE() for pxdp pointers with the pgtable helpers
but that will create too much code churn in a single patch. Thought of doing these
replacements per file will be much more contained which is easy both for review and
testing.
next prev parent reply other threads:[~2025-10-06 6:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 5:52 Anshuman Khandual
2025-10-06 6:07 ` Dev Jain
2025-10-06 6:28 ` Anshuman Khandual [this message]
2025-10-06 6:48 ` Lance Yang
2025-10-06 7:00 ` David Hildenbrand
2025-10-06 6:34 ` David Hildenbrand
2025-10-06 7:13 ` Dev Jain
2025-10-06 12:12 ` Oscar Salvador
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=1c948262-e201-4473-b156-8b90fedc9ce7@arm.com \
--to=anshuman.khandual@arm.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=dev.jain@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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