linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC v2 0/3] tlb: mmu_gather: use batched table free if possible
@ 2021-12-18 18:52 Nikita Yushchenko
  2021-12-18 18:52 ` [PATCH/RFC v2 1/3] tlb: mmu_gather: introduce CONFIG_MMU_GATHER_TABLE_FREE_COMMON Nikita Yushchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nikita Yushchenko @ 2021-12-18 18:52 UTC (permalink / raw)
  To: Will Deacon, Aneesh Kumar K.V, Andrew Morton, Nick Piggin,
	Peter Zijlstra, Catalin Marinas, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, Arnd Bergmann, Sam Ravnborg
  Cc: x86, linux-kernel, linux-arch, linux-mm, kernel

In mmu_gather code, the final table free in __tlb_remove_table_free()
executes a loop, calling arch hook __tlb_remove_table() to free each table
individually.

Several architectures use free_page_and_swap_cache() as their
__tlb_remove_table() implementation. Calling that in loop results into
individual calls to put_page() for each page being freed.

This patchset refactors the code to issue a single release_pages() call
in this case. This is expected to have better performance, especially when
memcg accounting is enabled.

Nikita Yushchenko (3):
  tlb: mmu_gather: introduce CONFIG_MMU_GATHER_TABLE_FREE_COMMON
  mm/swap: introduce free_pages_and_swap_cache_nolru()
  tlb: mmu_gather: use batched table free if possible

 arch/Kconfig                 |  3 +++
 arch/arm/Kconfig             |  1 +
 arch/arm/include/asm/tlb.h   |  5 -----
 arch/arm64/Kconfig           |  1 +
 arch/arm64/include/asm/tlb.h |  5 -----
 arch/x86/Kconfig             |  1 +
 arch/x86/include/asm/tlb.h   | 14 --------------
 include/asm-generic/tlb.h    |  5 +++++
 include/linux/swap.h         |  5 ++++-
 mm/mmu_gather.c              | 25 ++++++++++++++++++++++---
 mm/swap_state.c              | 29 ++++++++++++++++++++++-------
 11 files changed, 59 insertions(+), 35 deletions(-)

-- 
2.30.2


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

end of thread, other threads:[~2021-12-21 15:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-18 18:52 [PATCH/RFC v2 0/3] tlb: mmu_gather: use batched table free if possible Nikita Yushchenko
2021-12-18 18:52 ` [PATCH/RFC v2 1/3] tlb: mmu_gather: introduce CONFIG_MMU_GATHER_TABLE_FREE_COMMON Nikita Yushchenko
2021-12-21 13:21   ` Peter Zijlstra
2021-12-21 15:42     ` Nikita Yushchenko
2021-12-18 18:52 ` [PATCH/RFC v2 2/3] mm/swap: introduce free_pages_and_swap_cache_nolru() Nikita Yushchenko
2021-12-18 18:52 ` [PATCH/RFC v2 3/3] tlb: mmu_gather: use batched table free if possible Nikita Yushchenko

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).