Re: [PATCH v2 2/6] parisc: Drop own implementations for ptep_get() and ptep_test_and_clear_young()
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Date: 2026-08-04 11:11:35
Also in:
linux-arm-kernel, linux-fsdevel, linux-mm, lkml
On Mon, Aug 03, 2026 at 05:43:56PM +0100, Pedro Falcato wrote:
From: Helge Deller <deller@gmx.de> Switch to the generic implementations, which are identical.
You sure do like succinct commit messages :)
Maybe worth saying by dropping the __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG and
ptep_get defines you get the generic versions from include/pgtable.h which are
functionally identical.
(Being pedantic, they're not quite strictly identical as the
ptep_test_and_clear_young() generic function does some weird unnecessary
indirection with a local variable and the single {} is dropped etc.)
Suggested-by: Usama Arif <usama.arif@linux.dev> Suggested-by: John David Anglin <redacted> Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Pedro Falcato <pfalcato@suse.de>
Nits above notwithstanding, LGTM so: Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
quoted hunk ↗ jump to hunk
--- arch/parisc/include/asm/pgtable.h | 20 -------------------- 1 file changed, 20 deletions(-)diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index 467b8547ac8b..d92dee9fef3f 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h@@ -432,25 +432,6 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte) return pte; } -static inline pte_t ptep_get(pte_t *ptep) -{ - return READ_ONCE(*ptep); -} -#define ptep_get ptep_get - -static inline bool ptep_test_and_clear_young(struct vm_area_struct *vma, - unsigned long addr, pte_t *ptep) -{ - pte_t pte; - - pte = ptep_get(ptep); - if (!pte_young(pte)) { - return false; - } - set_pte_at(vma->vm_mm, addr, ptep, pte_mkold(pte)); - return true; -} - bool ptep_clear_flush_young(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep); pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep);@@ -491,7 +472,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, #define HAVE_ARCH_UNMAPPED_AREA #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN -#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH #define __HAVE_ARCH_PTEP_CLEAR_FLUSH #define __HAVE_ARCH_PTEP_SET_WRPROTECT --2.55.0
-- Cheers, Lorenzo