mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
d39268ad24
0day reported a regression on a microbenchmark which is intended to
stress the TLB flushing path:
https://lore.kernel.org/all/20220317090415.GE735@xsang-OptiPlex-9020/
It pointed at a commit from Nadav which intended to remove retpoline
overhead in the TLB flushing path by taking the 'cond'-ition in
on_each_cpu_cond_mask(), pre-calculating it, and incorporating it into
'cpumask'. That allowed the code to use a bunch of earlier direct
calls instead of later indirect calls that need a retpoline.
But, in practice, threads can go idle (and into lazy TLB mode where
they don't need to flush their TLB) between the early and late calls.
It works in this direction and not in the other because TLB-flushing
threads tend to hold mmap_lock for write. Contention on that lock
causes threads to _go_ idle right in this early/late window.
There was not any performance data in the original commit specific
to the retpoline overhead. I did a few tests on a system with
retpolines:
https://lore.kernel.org/all/dd8be93c-ded6-b962-50d4-96b1c3afb2b7@intel.com/
which showed a possible small win. But, that small win pales in
comparison with the bigger loss induced on non-retpoline systems.
Revert the patch that removed the retpolines. This was not a
clean revert, but it was self-contained enough not to be too painful.
Fixes:
|
||
---|---|---|
.. | ||
pat | ||
amdtopology.c | ||
cpu_entry_area.c | ||
debug_pagetables.c | ||
dump_pagetables.c | ||
extable.c | ||
fault.c | ||
highmem_32.c | ||
hugetlbpage.c | ||
ident_map.c | ||
init_32.c | ||
init_64.c | ||
init.c | ||
iomap_32.c | ||
ioremap.c | ||
kasan_init_64.c | ||
kaslr.c | ||
kmmio.c | ||
maccess.c | ||
Makefile | ||
mem_encrypt_amd.c | ||
mem_encrypt_boot.S | ||
mem_encrypt_identity.c | ||
mem_encrypt.c | ||
mm_internal.h | ||
mmap.c | ||
mmio-mod.c | ||
numa_32.c | ||
numa_64.c | ||
numa_emulation.c | ||
numa_internal.h | ||
numa.c | ||
pf_in.c | ||
pf_in.h | ||
pgtable_32.c | ||
pgtable.c | ||
physaddr.c | ||
physaddr.h | ||
pkeys.c | ||
pti.c | ||
setup_nx.c | ||
srat.c | ||
testmmiotrace.c | ||
tlb.c |