x86,tlb,mm: make lazy TLB mode even lazier
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest7 patches 31 repliesIn review
- v57 patches 7 repliesSuperseded
- v47 patches 6 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 7 patches | 9 replies | Superseded | |
| v2 | 0 of 7 patches | 0 replies | Superseded | |
| v1 | 7 patches | 21 replies | Superseded |
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | mm: allocate mm_cpumask dynamically based on nr_cpu_idsdrivers/ include/ kernel/ +1 more | +145 | 1 reply | |
| 2/7 | x86,tlb: leave lazy TLB mode at page table free timearch/ arch/ include/ +1 more | +56 | 4 replies | |
| 3/7 | x86,mm: restructure switch_mm_irqs_offarch/ | +30 | 0 replies | |
| 4/7 | x86,tlb: make lazy TLB mode lazierarch/ | +59 | 24 replies | |
| 5/7 | x86,tlb: only send page table free TLB flush to lazy TLB CPUsarch/ | +39 | 2 replies | |
| 6/7 | x86,mm: always use lazy TLB modearch/ arch/ | +1 | 0 replies | |
| 7/7 | x86,switch_mm: skip atomic operations for init_mmarch/ | +12 | 0 replies |
Reviews trailers per patch
All 7 patches have a Reviewed-by or Acked-by.
| Patch | Dave Hansen | Song Liu |
|---|---|---|
| 1/7 | A-b | T-b |
| 2/7 | A-b | T-b |
| 3/7 | A-b | |
| 4/7 | A-b | T-b |
| 5/7 | A-b | T-b |
| 6/7 | A-b | T-b |
| 7/7 | A-b | Reported-and-tested-by |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v6 0/7] x86,tlb,mm: make lazy TLB mode even lazier
Song noticed switch_mm_irqs_off taking a lot of CPU time in recent kernels, using 1.9% of a 48 CPU system during a netperf run. Digging into the profile, the atomic operations in cpumask_clear_cpu and cpumask_set_cpu are responsible for about half of that CPU use.
However, the CPUs running netperf are simply switching back and forth between netperf and the idle task, which does not require any changes to the mm_cpumask if lazy TLB mode were used.
Additionally, the init_mm cpumask ends up being the most heavily contended one in the system, for no reason at all.
Making really lazy TLB mode work again on modern kernels, by sending a shootdown IPI only when page table pages are being unmapped, we get back some performance.
v6 addresses the comment and Signed-off-by issues pointed out by Ingo.
On memcache workloads on 2 socket systems, this patch series seems to reduce total system CPU use by 1-2%. On Song's netbench tests, CPU use in the context switch time is about cut in half.
These patches also provide a little memory savings by shrinking the size of mm_struct, especially on distro kernels compiled with a gigantically large NR_CPUS.