From: Barry Song <[email protected]> Oven observed most mmap_lock contention and priority inversion come from page fault retries after waiting for I/O completion. Oven subsequently raised the following idea:
There is no need to always fall back to mmap_lock if the per-VMA lock was released only to wait for pagecache or swapcache to become ready. In this case, the retry path can continue using the per-VMA lock. This is a big win: it greatly reduces mmap_lock acquisitions. Oven Liyang (1): mm/filemap: Retry fault by VMA lock if the lock was released for I/O Barry Song (1): mm/swapin: Retry swapin by VMA lock if the lock was released for I/O arch/arm/mm/fault.c | 5 +++++ arch/arm64/mm/fault.c | 5 +++++ arch/loongarch/mm/fault.c | 4 ++++ arch/powerpc/mm/fault.c | 5 ++++- arch/riscv/mm/fault.c | 4 ++++ arch/s390/mm/fault.c | 4 ++++ arch/x86/mm/fault.c | 4 ++++ include/linux/mm_types.h | 9 +++++---- mm/filemap.c | 5 ++++- mm/memory.c | 10 ++++++++-- 10 files changed, 47 insertions(+), 8 deletions(-) Cc: Russell King <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Huacai Chen <[email protected]> Cc: WANG Xuerui <[email protected]> Cc: Madhavan Srinivasan <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Paul Walmsley <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Albert Ou <[email protected]> Cc: Alexandre Ghiti <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Gerald Schaefer <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: [email protected] Cc: H. Peter Anvin <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Lorenzo Stoakes <[email protected]> Cc: Liam R. Howlett <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Pedro Falcato <[email protected]> Cc: Jarkko Sakkinen <[email protected]> Cc: Oscar Salvador <[email protected]> Cc: Kuninori Morimoto <[email protected]> Cc: Oven Liyang <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Ada Couprie Diaz <[email protected]> Cc: Robin Murphy <[email protected]> Cc: Kristina Martšenko <[email protected]> Cc: Kevin Brodsky <[email protected]> Cc: Yeoreum Yun <[email protected]> Cc: Wentao Guan <[email protected]> Cc: Thorsten Blum <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Yunhui Cui <[email protected]> Cc: Nam Cao <[email protected]> Cc: Chris Li <[email protected]> Cc: Kairui Song <[email protected]> Cc: Kemeng Shi <[email protected]> Cc: Nhat Pham <[email protected]> Cc: Baoquan He <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] -- 2.39.3 (Apple Git-146)
