linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] riscv: tlb: avoid tlb flushing on exit & execve
@ 2023-12-28  8:46 Jisheng Zhang
  2023-12-28  8:46 ` [PATCH 1/2] mm/tlb: fix fullmm semantics Jisheng Zhang
  2023-12-28  8:46 ` [PATCH 2/2] riscv: tlb: avoid tlb flushing if fullmm == 1 Jisheng Zhang
  0 siblings, 2 replies; 13+ messages in thread
From: Jisheng Zhang @ 2023-12-28  8:46 UTC (permalink / raw)
  To: Will Deacon, Aneesh Kumar K . V, Andrew Morton, Nick Piggin,
	Peter Zijlstra, Catalin Marinas, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Arnd Bergmann
  Cc: linux-arch, linux-mm, linux-arm-kernel, linux-kernel, linux-riscv

The mmu_gather code sets fullmm=1 when tearing down the entire address
space for an mm_struct on exit or execve. So if the underlying platform
supports ASID, the tlb flushing can be avoided because the ASID
allocator will never re-allocate a dirty ASID.

But currently, the tlb_finish_mmu() sets fullmm, when in fact it wants
to say that the TLB should be fully flushed.

So patch1 takes one of Nadav's patch from [1] to fix fullmm semantics.
Compared with original patch from[1], the differences are:
a. fixes the fullmm semantics in arm64 too
b. bring back the fullmm optimization back on arm64.

patch2 does the optimization on riscv.

Use the performance of Process creation in unixbench on T-HEAD TH1520
platform is improved by about 4%.

Link: https://lore.kernel.org/linux-mm/20210131001132.3368247-2-namit@vmware.com/ [1]

Jisheng Zhang (1):
  riscv: tlb: avoid tlb flushing if fullmm == 1

Nadav Amit (1):
  mm/tlb: fix fullmm semantics

 arch/arm64/include/asm/tlb.h | 5 ++++-
 arch/riscv/include/asm/tlb.h | 9 +++++++++
 include/asm-generic/tlb.h    | 2 +-
 mm/mmu_gather.c              | 2 +-
 4 files changed, 15 insertions(+), 3 deletions(-)

-- 
2.40.0



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-01-04 13:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-28  8:46 [PATCH 0/2] riscv: tlb: avoid tlb flushing on exit & execve Jisheng Zhang
2023-12-28  8:46 ` [PATCH 1/2] mm/tlb: fix fullmm semantics Jisheng Zhang
2023-12-30  9:54   ` Nadav Amit
2024-01-02  2:41     ` Jisheng Zhang
2024-01-04 13:26       ` Nadav Amit
2024-01-03 17:50   ` Will Deacon
2024-01-03 17:57     ` Will Deacon
2024-01-03 18:05   ` Catalin Marinas
2024-01-03 20:26     ` Dave Hansen
2023-12-28  8:46 ` [PATCH 2/2] riscv: tlb: avoid tlb flushing if fullmm == 1 Jisheng Zhang
2023-12-30 18:26   ` Alexandre Ghiti
2024-01-02  3:12     ` Jisheng Zhang
2024-01-04 13:00       ` Alexandre Ghiti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox