riscv: mremap speedup - enable HAVE_MOVE_PUD and HAVE_MOVE_PMD
PATCH 1/1 riscv: mremap speedup - enable HAVE_MOVE_PUD and HAVE_MOVE_PMD
From: Jisheng Zhang <[email protected]>
HAVE_MOVE_PUD enables remapping pages at the PUD level if both the source and destination addresses are PUD-aligned.HAVE_MOVE_PMD does similar speedup on the PMD level.
With HAVE_MOVE_PUD enabled, there is about a 143x improvement on qemu With HAVE_MOVE_PMD enabled, there is about a 5x improvement on qemu
---
Hi all,
After reading the risc-v privileged spec, I think it's safe to support the HAVE_MOVE_PUD and HAVE_MOVE_PMD optimization on riscv. The patch passed the mremap_test on QEMU. However this can't be tested on real HW due to lack of HW boards, this is the reason why I mark this patch as RFT. I hope I can buy a sipeed Allwiner D1 SoC powered SBC soon, at least I can test HAVE_MOVE_PMD. Helping me to test on real HW is appreciated!
Thanks
arch/riscv/Kconfig | 2 ++ arch/riscv/include/asm/pgtable.h | 12 ++++++++++++ 2 files changed, 14 insertions(+)
arch/riscv/Kconfig +2 -0
@@ -80,6 +80,8 @@ config RISCV select HAVE_KPROBES select HAVE_KPROBES_ON_FTRACE select HAVE_KRETPROBES + select HAVE_MOVE_PMD + select HAVE_MOVE_PUD select HAVE_PCI select HAVE_PERF_EVENTS select HAVE_PERF_REGS
arch/riscv/include/asm/pgtable.h +12 -0
@@ -360,6 +360,18 @@ static inline void set_pte_at(struct mm_struct *mm,set_pte (ptep, pteval); } +static inline void set_pmd_at (struct mm_struct *mm,unsigned long addr, +pmd_t *pmdp,pmd_t pmd) +{ +set_pmd (pmdp, pmd); +} + +static inline void set_pud_at (struct mm_struct *mm,unsigned long addr, +pud_t *pudp,pud_t pud) +{ +set_pud (pudp, pud); +} +static inline void pte_clear (struct mm_struct *mm,unsigned long addr,pte_t *ptep) {
Signature · 1 line
2.31.0
Palmer Dabbelt
maintainerQuoted 52 lines · On Fri, 16 Apr 2021 09:37:22 PDT (-0700), [email protected] wrote:
From: Jisheng Zhang <[email protected]>
HAVE_MOVE_PUDenables remapping pages at the PUD level if both the source and destination addresses are PUD-aligned.HAVE_MOVE_PMDdoes similar speedup on the PMD level.With
HAVE_MOVE_PUDenabled, there is about a 143x improvement on qemu WithHAVE_MOVE_PMDenabled, there is about a 5x improvement on qemuSigned-off-by Jisheng Zhang <[email protected]>---
Hi all,After reading the risc-v privileged spec, I think it's safe to support the
HAVE_MOVE_PUDandHAVE_MOVE_PMDoptimization on riscv. The patch passed themremap_teston QEMU. However this can't be tested on real HW due to lack of HW boards, this is the reason why I mark this patch as RFT. I hope I can buy a sipeed Allwiner D1 SoC powered SBC soon, at least I can testHAVE_MOVE_PMD. Helping me to test on real HW is appreciated!Thanks
arch/riscv/Kconfig | 2 ++ arch/riscv/include/asm/pgtable.h | 12 ++++++++++++ 2 files changed, 14 insertions(+)arch/riscv/Kconfig +2
-0@@ -80,6 +80,8 @@ config RISCV select HAVE_KPROBES select HAVE_KPROBES_ON_FTRACE select HAVE_KRETPROBES + select HAVE_MOVE_PMD + select HAVE_MOVE_PUD select HAVE_PCI select HAVE_PERF_EVENTS select HAVE_PERF_REGSarch/riscv/include/asm/pgtable.h +5
-0@@ -360,6 +360,18 @@ static inline void set_pte_at(struct mm_struct *mm,set_pte (ptep, pteval); } +static inline void set_pmd_at (struct mm_struct *mm,unsigned long addr, +pmd_t *pmdp,pmd_t pmd) +{ +set_pmd (pmdp, pmd); +}
arch/riscv/include/asm/pgtable.h static inline void set_pte_at(struct mm_struct *mm, · line 377
Quoted 10 lines
arch/riscv/include/asm/pgtable.h +7
-0+ +static inline void set_pud_at (struct mm_struct *mm,unsigned long addr, +pud_t *pudp,pud_t pud) +{ +set_pud (pudp, pud); +} +static inline void pte_clear (struct mm_struct *mm,unsigned long addr,pte_t *ptep) {
Thanks, this is on for-next.