linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] skip redundant TLB sync IPIs
@ 2025-12-13  8:00 Lance Yang
  2025-12-13  8:00 ` [PATCH RFC 1/3] mm/tlb: allow architectures to " Lance Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Lance Yang @ 2025-12-13  8:00 UTC (permalink / raw)
  To: akpm
  Cc: will, aneesh.kumar, npiggin, peterz, tglx, mingo, bp, dave.hansen,
	x86, hpa, arnd, david, lorenzo.stoakes, ziy, baolin.wang,
	Liam.Howlett, npache, ryan.roberts, dev.jain, baohua, ioworker0,
	shy828301, riel, jannh, linux-arch, linux-mm, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1334 bytes --]

Hi all,

When unsharing hugetlb PMD page tables or collapsing pages in khugepaged,
we send two IPIs: one for TLB invalidation, and another to synchronize
with concurrent GUP-fast walkers. However, if the TLB flush already
reaches all CPUs, the second IPI is redundant. GUP-fast runs with IRQs
disabled, so when the TLB flush IPI completes, any concurrent GUP-fast
must have finished.

This series introduces a way for architectures to indicate their TLB flush
already provides full synchronization, allowing the redundant IPI to be
skipped. For now, the optimization is implemented for x86 first and applied
to both hugetlb PMD unsharing and khugepaged. I will dig into other
architectures later, and folks maintaining other architectures are welcome
to help out.

David Hildenbrand did the initial implementation. I just built on his work
and relied on off-list discussions to push it further — thanks a lot David!

Lance Yang (3):
  mm/tlb: allow architectures to skip redundant TLB sync IPIs
  x86/mm: implement redundant IPI elimination for PMD unsharing
  mm/khugepaged: skip redundant IPI in collapse_huge_page()

 arch/x86/include/asm/tlb.h | 17 ++++++++++++++++-
 include/asm-generic/tlb.h  | 22 +++++++++++++++++++++-
 mm/khugepaged.c            |  7 ++++++-
 3 files changed, 43 insertions(+), 3 deletions(-)

-- 
2.49.0


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

end of thread, other threads:[~2025-12-23 11:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-13  8:00 [PATCH RFC 0/3] skip redundant TLB sync IPIs Lance Yang
2025-12-13  8:00 ` [PATCH RFC 1/3] mm/tlb: allow architectures to " Lance Yang
2025-12-15  5:48   ` Lance Yang
2025-12-18 13:08     ` David Hildenbrand (Red Hat)
2025-12-13  8:00 ` [PATCH RFC 2/3] x86/mm: implement redundant IPI elimination for PMD unsharing Lance Yang
2025-12-18 13:08   ` David Hildenbrand (Red Hat)
2025-12-22  3:19     ` [PATCH RFC 2/3] x86/mm: implement redundant IPI elimination for Lance Yang
2025-12-23  9:44       ` David Hildenbrand (Red Hat)
2025-12-23 11:13         ` Lance Yang
2025-12-13  8:00 ` [PATCH RFC 3/3] mm/khugepaged: skip redundant IPI in collapse_huge_page() Lance Yang
2025-12-18 13:13   ` David Hildenbrand (Red Hat)
2025-12-18 14:35     ` Lance Yang
2025-12-19  8:25       ` David Hildenbrand (Red Hat)
2025-12-21 10:43         ` Lance Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).