alistair23-linux/arch/x86
Rik van Riel ac03158969 x86/mm/tlb: Make lazy TLB mode lazier
Lazy TLB mode can result in an idle CPU being woken up by a TLB flush,
when all it really needs to do is reload %CR3 at the next context switch,
assuming no page table pages got freed.

Memory ordering is used to prevent race conditions between switch_mm_irqs_off,
which checks whether .tlb_gen changed, and the TLB invalidation code, which
increments .tlb_gen whenever page table entries get invalidated.

The atomic increment in inc_mm_tlb_gen is its own barrier; the context
switch code adds an explicit barrier between reading tlbstate.is_lazy and
next->context.tlb_gen.

Unlike the 2016 version of this patch, CPUs with cpu_tlbstate.is_lazy set
are not removed from the mm_cpumask(mm), since that would prevent the TLB
flush IPIs at page table free time from being sent to all the CPUs
that need them.

This patch reduces total CPU use in the system by about 1-2% for a
memcache workload on two socket systems, and by about 1% for a heavily
multi-process netperf between two systems.

Tested-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Rik van Riel <riel@surriel.com>
Acked-by: Dave Hansen <dave.hansen@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: efault@gmx.de
Cc: kernel-team@fb.com
Cc: luto@kernel.org
Link: http://lkml.kernel.org/r/20180716190337.26133-5-riel@surriel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-07-17 09:35:33 +02:00
..
boot efi/x86: Fix mixed mode reboot loop by removing pointless call to PciIo->Attributes() 2018-07-11 13:15:21 +02:00
configs
crypto crypto: x86 - Add missing RETs 2018-07-01 23:33:20 +08:00
entry x86/entry/64/compat: Fix "x86/entry/64/compat: Preserve r8-r11 in int $0x80" 2018-06-27 09:35:40 +02:00
events treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
hyperv x86/hyper-v: Fix the circular dependency in IPI enlightenment 2018-07-06 12:32:59 +02:00
ia32
include x86/mm/tlb: Leave lazy TLB mode at page table free time 2018-07-17 09:35:31 +02:00
kernel Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-07-08 13:56:25 -07:00
kvm kvm: vmx: Nested VM-entry prereqs for event inj. 2018-06-22 16:46:26 +02:00
lib libnvdimm for 4.18 2018-06-08 17:21:52 -07:00
math-emu
mm x86/mm/tlb: Make lazy TLB mode lazier 2018-07-17 09:35:33 +02:00
net treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
oprofile
pci treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
platform x86/efi: Fix efi_call_phys_epilog() with CONFIG_X86_5LEVEL=y 2018-06-27 09:52:52 +02:00
power
purgatory x86/purgatory: add missing FORCE to Makefile target 2018-07-14 11:11:09 -07:00
ras
realmode
tools
um Kconfig updates for v4.18 2018-06-06 11:31:45 -07:00
video
xen xen: fixes for 4.18-rc5 2018-07-14 12:30:13 -07:00
.gitignore
Kbuild
Kconfig Kbuild: rename HAVE_CC_STACKPROTECTOR config variable 2018-06-15 07:15:28 +09:00
Kconfig.cpu
Kconfig.debug
Makefile Merge branch 'linus' into x86/urgent 2018-06-22 21:20:35 +02:00
Makefile.um
Makefile_32.cpu