From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Pedro Falcato <pfalcato@suse.de>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
Helge Deller <deller@gmx.de>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Lorenzo Stoakes <ljs@kernel.org>,
"Liam R. Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
Jan Kara <jack@suse.cz>, Zi Yan <ziy@nvidia.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Nico Pache <npache@redhat.com>,
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>,
Kevin Brodsky <kevin.brodsky@arm.com>,
Muhammad Usama Anjum <usama.anjum@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/5] mm: constify generic pte_get*()
Date: Mon, 27 Jul 2026 15:44:25 +0200 [thread overview]
Message-ID: <ac1e42b2-eee5-42cc-bf1e-dfdc5225adeb@kernel.org> (raw)
In-Reply-To: <20260724102017.141532-2-pfalcato@suse.de>
On 7/24/26 12:20, Pedro Falcato wrote:
> None of the helpers need write access to the PTE. Constifying the param
> allows for const typesafety.
>
> Signed-off-by: Pedro Falcato <pfalcato@suse.de>
> ---
> include/linux/pgtable.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
> index 8c093c119e5a..dc418553e57a 100644
> --- a/include/linux/pgtable.h
> +++ b/include/linux/pgtable.h
> @@ -490,7 +490,7 @@ static inline int pudp_set_access_flags(struct vm_area_struct *vma,
> #endif
>
> #ifndef ptep_get
> -static inline pte_t ptep_get(pte_t *ptep)
> +static inline pte_t ptep_get(const pte_t *ptep)
> {
> return READ_ONCE(*ptep);
> }
> @@ -739,7 +739,7 @@ static inline void ptep_clear(struct mm_struct *mm, unsigned long addr,
> * present bit set *unless* it is 'l'. Because get_user_pages_fast() only
> * operates on present ptes we're safe.
> */
> -static inline pte_t ptep_get_lockless(pte_t *ptep)
> +static inline pte_t ptep_get_lockless(const pte_t *ptep)
> {
> pte_t pte;
>
> @@ -777,7 +777,7 @@ static inline pmd_t pmdp_get_lockless(pmd_t *pmdp)
> * We require that the PTE can be read atomically.
> */
> #ifndef ptep_get_lockless
> -static inline pte_t ptep_get_lockless(pte_t *ptep)
> +static inline pte_t ptep_get_lockless(const pte_t *ptep)
> {
> return ptep_get(ptep);
> }
Yes, that's a step into the right direction.
--
Cheers,
David
next prev parent reply other threads:[~2026-07-27 13:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 10:20 [PATCH 0/5] mm: add basic PTE const type-safety Pedro Falcato
2026-07-24 10:20 ` [PATCH 1/5] mm: constify generic pte_get*() Pedro Falcato
2026-07-27 13:44 ` David Hildenbrand (Arm) [this message]
2026-07-24 10:20 ` [PATCH 2/5] mm/arm64: constify pte_get*() and contpte get logic Pedro Falcato
2026-07-24 10:20 ` [PATCH 3/5] mm/parisc: constify ptep_get() argument Pedro Falcato
2026-07-24 13:36 ` Usama Arif
2026-07-24 13:39 ` Usama Arif
2026-07-24 14:14 ` Matthew Wilcox
2026-07-24 15:03 ` Usama Arif
2026-07-24 15:32 ` Pedro Falcato
2026-07-24 15:48 ` Usama Arif
2026-07-25 16:27 ` Helge Deller
2026-07-25 17:00 ` John David Anglin
2026-07-25 17:38 ` Helge Deller
2026-07-27 9:14 ` Pedro Falcato
2026-07-24 10:20 ` [PATCH 4/5] mm/powerpc/8xx: " Pedro Falcato
2026-07-24 10:20 ` [PATCH 5/5] mm: constify the pte_offset_map_ro_nolock() return value Pedro Falcato
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=ac1e42b2-eee5-42cc-bf1e-dfdc5225adeb@kernel.org \
--to=david@kernel.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=catalin.marinas@arm.com \
--cc=deller@gmx.de \
--cc=dev.jain@arm.com \
--cc=jack@suse.cz \
--cc=kevin.brodsky@arm.com \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=ljs@kernel.org \
--cc=maddy@linux.ibm.com \
--cc=mhocko@suse.com \
--cc=mpe@ellerman.id.au \
--cc=npache@redhat.com \
--cc=pfalcato@suse.de \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=surenb@google.com \
--cc=usama.anjum@arm.com \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
--cc=will@kernel.org \
--cc=willy@infradead.org \
--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