lazy tlb: allow lazy tlb mm refcounting to be configurable
authorNicholas Piggin <npiggin@gmail.com>
Fri, 3 Feb 2023 07:18:35 +0000 (17:18 +1000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 28 Mar 2023 23:20:08 +0000 (16:20 -0700)
commit88e3009b5283bbd41447f0352d0b9df16cf6f183
tree8b1bd9f8227e2ded210820aede11453565397f4c
parentaa464ba9a1e444d5ef95bb63ee3b2ef26fc96ed7
lazy tlb: allow lazy tlb mm refcounting to be configurable

Add CONFIG_MMU_TLB_REFCOUNT which enables refcounting of the lazy tlb mm
when it is context switched.  This can be disabled by architectures that
don't require this refcounting if they clean up lazy tlb mms when the last
refcount is dropped.  Currently this is always enabled, so the patch
introduces no functional change.

Link: https://lkml.kernel.org/r/20230203071837.1136453-4-npiggin@gmail.com
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nadav Amit <nadav.amit@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/mm/active_mm.rst
arch/Kconfig
include/linux/sched/mm.h