diff options
| author | Rik van Riel <[email protected]> | 2024-11-14 15:26:16 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2024-11-19 11:02:46 +0000 |
| commit | 209954cbc7d0ce1a190fc725d20ce303d74d2680 (patch) | |
| tree | bd9e8fe18c7d837b73433cb2bcdb545a395a85ff /net/unix/af_unix.c | |
| parent | x86/mm/tlb: Put cpumask_test_cpu() check in switch_mm_irqs_off() under CONFIG... (diff) | |
| download | kernel-209954cbc7d0ce1a190fc725d20ce303d74d2680.tar.gz kernel-209954cbc7d0ce1a190fc725d20ce303d74d2680.zip | |
x86/mm/tlb: Update mm_cpumask lazily
On busy multi-threaded workloads, there can be significant contention
on the mm_cpumask at context switch time.
Reduce that contention by updating mm_cpumask lazily, setting the CPU bit
at context switch time (if not already set), and clearing the CPU bit at
the first TLB flush sent to a CPU where the process isn't running.
When a flurry of TLB flushes for a process happen, only the first one
will be sent to CPUs where the process isn't running. The others will
be sent to CPUs where the process is currently running.
On an AMD Milan system with 36 cores, there is a noticeable difference:
$ hackbench --groups 20 --loops 10000
Before: ~4.5s +/- 0.1s
After: ~4.2s +/- 0.1s
Signed-off-by: Rik van Riel <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Mel Gorman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
