| Message ID | 6a4192f5cef3049f123f08cb04ef5cd0179c3281.1763117269.git.zhengqi.arch@bytedance.com |
|---|---|
| State | Not Applicable |
| Headers | show |
| Series | enable PT_RECLAIM on all 64-bit architectures | expand |
On 11/14/25 7:11 PM, Qi Zheng wrote: > From: Qi Zheng <zhengqi.arch@bytedance.com> > > On a 64-bit system, madvise(MADV_DONTNEED) may cause a large number of > empty PTE page table pages (such as 100GB+). To resolve this problem, > first enable MMU_GATHER_RCU_TABLE_FREE to prepare for enabling the > PT_RECLAIM feature, which resolves this problem. > > Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com> > Cc: Vineet Gupta <vgupta@kernel.org> > --- > arch/arc/Kconfig | 1 + > arch/arc/include/asm/pgalloc.h | 9 ++++++--- > 2 files changed, 7 insertions(+), 3 deletions(-) Strangely, it seems that only ARC does not define CONFIG_64BIT? Does the ARC architecture support 64-bit? Did I miss something? > > diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig > index f27e6b90428e4..47db93952386d 100644 > --- a/arch/arc/Kconfig > +++ b/arch/arc/Kconfig > @@ -54,6 +54,7 @@ config ARC > select HAVE_ARCH_JUMP_LABEL if ISA_ARCV2 && !CPU_ENDIAN_BE32 > select TRACE_IRQFLAGS_SUPPORT > select HAVE_EBPF_JIT if ISA_ARCV2 > + select MMU_GATHER_RCU_TABLE_FREE > > config LOCKDEP_SUPPORT > def_bool y > diff --git a/arch/arc/include/asm/pgalloc.h b/arch/arc/include/asm/pgalloc.h > index dfae070fe8d55..b1c6619435613 100644 > --- a/arch/arc/include/asm/pgalloc.h > +++ b/arch/arc/include/asm/pgalloc.h > @@ -72,7 +72,8 @@ static inline void p4d_populate(struct mm_struct *mm, p4d_t *p4dp, pud_t *pudp) > set_p4d(p4dp, __p4d((unsigned long)pudp)); > } > > -#define __pud_free_tlb(tlb, pmd, addr) pud_free((tlb)->mm, pmd) > +#define __pud_free_tlb(tlb, pud, addr) \ > + tlb_remove_ptdesc((tlb), virt_to_ptdesc(pud)) > > #endif > > @@ -83,10 +84,12 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmdp) > set_pud(pudp, __pud((unsigned long)pmdp)); > } > > -#define __pmd_free_tlb(tlb, pmd, addr) pmd_free((tlb)->mm, pmd) > +#define __pmd_free_tlb(tlb, pmd, addr) \ > + tlb_remove_ptdesc((tlb), virt_to_ptdesc(pmd)) > > #endif > > -#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte) > +#define __pte_free_tlb(tlb, pte, addr) \ > + tlb_remove_ptdesc((tlb), page_ptdesc(pte)) > > #endif /* _ASM_ARC_PGALLOC_H */
On 11/14/25 03:20, Qi Zheng wrote: > Strangely, it seems that only ARC does not define CONFIG_64BIT? > > Does the ARC architecture support 64-bit? Did I miss something? ARC is 32-bit only ! -Vineet
On 11/15/25 7:10 AM, Vineet Gupta wrote: > On 11/14/25 03:20, Qi Zheng wrote: >> Strangely, it seems that only ARC does not define CONFIG_64BIT? >> >> Does the ARC architecture support 64-bit? Did I miss something? > > ARC is 32-bit only ! Got it! Will drop this patch in the next version. Thanks! > > -Vineet
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index f27e6b90428e4..47db93952386d 100644 --- a/arch/arc/Kconfig +++ b/arch/arc/Kconfig @@ -54,6 +54,7 @@ config ARC select HAVE_ARCH_JUMP_LABEL if ISA_ARCV2 && !CPU_ENDIAN_BE32 select TRACE_IRQFLAGS_SUPPORT select HAVE_EBPF_JIT if ISA_ARCV2 + select MMU_GATHER_RCU_TABLE_FREE config LOCKDEP_SUPPORT def_bool y diff --git a/arch/arc/include/asm/pgalloc.h b/arch/arc/include/asm/pgalloc.h index dfae070fe8d55..b1c6619435613 100644 --- a/arch/arc/include/asm/pgalloc.h +++ b/arch/arc/include/asm/pgalloc.h @@ -72,7 +72,8 @@ static inline void p4d_populate(struct mm_struct *mm, p4d_t *p4dp, pud_t *pudp) set_p4d(p4dp, __p4d((unsigned long)pudp)); } -#define __pud_free_tlb(tlb, pmd, addr) pud_free((tlb)->mm, pmd) +#define __pud_free_tlb(tlb, pud, addr) \ + tlb_remove_ptdesc((tlb), virt_to_ptdesc(pud)) #endif @@ -83,10 +84,12 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmdp) set_pud(pudp, __pud((unsigned long)pmdp)); } -#define __pmd_free_tlb(tlb, pmd, addr) pmd_free((tlb)->mm, pmd) +#define __pmd_free_tlb(tlb, pmd, addr) \ + tlb_remove_ptdesc((tlb), virt_to_ptdesc(pmd)) #endif -#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, pte) +#define __pte_free_tlb(tlb, pte, addr) \ + tlb_remove_ptdesc((tlb), page_ptdesc(pte)) #endif /* _ASM_ARC_PGALLOC_H */