]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lazy tlb: introduce lazy mm refcount helper functions
authorNicholas Piggin <npiggin@gmail.com>
Mon, 23 Aug 2021 23:59:18 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:33:55 +0000 (09:33 +1000)
commit0e0cf30edccbf9cdb926f7ea8a60665d65e7f587
tree63b82de9b7fc084d6c37cc54b49052a88d6a8f0e
parent3d32d8de91ff84c836f44ed2be33854b53811e6d
lazy tlb: introduce lazy mm refcount helper functions

Patch series "shoot lazy tlbs", v4.

On a 16-socket 192-core POWER8 system, a context switching benchmark with
as many software threads as CPUs (so each switch will go in and out of
idle), upstream can achieve a rate of about 1 million context switches per
second.  After this series it goes up to 118 million.

This patch (of 4):

Add explicit _lazy_tlb annotated functions for lazy mm refcounting.  This
makes lazy mm references more obvious, and allows explicit refcounting to
be removed if it is not used.

If a kernel thread's current lazy tlb mm happens to be the one it wants to
use, then kthread_use_mm() cleverly transfers the mm refcount from the
lazy tlb mm reference to the returned reference.  If the lazy tlb mm
reference is no longer identical to a normal reference, this trick does
not work, so that is changed to be explicit about the two references.

Link: https://lkml.kernel.org/r/20210605014216.446867-1-npiggin@gmail.com
Link: https://lkml.kernel.org/r/20210605014216.446867-2-npiggin@gmail.com
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Anton Blanchard <anton@ozlabs.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
arch/arm/mach-rpc/ecard.c
arch/powerpc/kernel/smp.c
arch/powerpc/mm/book3s64/radix_tlb.c
fs/exec.c
include/linux/sched/mm.h
kernel/cpu.c
kernel/exit.c
kernel/kthread.c
kernel/sched/core.c