linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] x86,tlb,mm: make lazy TLB mode even lazier
@ 2018-06-29 14:29 Rik van Riel
  2018-06-29 14:29 ` [PATCH 1/7] mm: allocate mm_cpumask dynamically based on nr_cpu_ids Rik van Riel
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Rik van Riel @ 2018-06-29 14:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: x86, luto, dave.hansen, mingo, kernel-team, tglx, efault,
	songliubraving, hpa

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.

v3 of the series addresses Andy Lutomirski's latest comments, and
seems to work well.

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.


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-07-07 21:21 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-29 14:29 [PATCH v3 0/7] x86,tlb,mm: make lazy TLB mode even lazier Rik van Riel
2018-06-29 14:29 ` [PATCH 1/7] mm: allocate mm_cpumask dynamically based on nr_cpu_ids Rik van Riel
2018-06-30  4:30   ` kbuild test robot
2018-06-29 14:29 ` [PATCH 2/7] x86,tlb: leave lazy TLB mode at page table free time Rik van Riel
2018-06-29 16:39   ` Dave Hansen
2018-06-29 16:56     ` Rik van Riel
2018-06-29 14:29 ` [PATCH 3/7] x86,mm: restructure switch_mm_irqs_off Rik van Riel
2018-06-29 16:49   ` Dave Hansen
2018-06-29 14:29 ` [PATCH 4/7] x86,tlb: make lazy TLB mode lazier Rik van Riel
2018-06-29 17:05   ` Dave Hansen
2018-06-29 17:29     ` Rik van Riel
2018-06-29 14:29 ` [PATCH 5/7] x86,tlb: only send page table free TLB flush to lazy TLB CPUs Rik van Riel
2018-07-07 12:26   ` Mike Galbraith
2018-07-07 13:39     ` Mike Galbraith
2018-07-07 21:21     ` Rik van Riel
2018-06-29 14:29 ` [PATCH 6/7] x86,mm: always use lazy TLB mode Rik van Riel
2018-06-29 14:29 ` [PATCH 7/7] x86,switch_mm: skip atomic operations for init_mm Rik van Riel
2018-06-29 17:06 ` [PATCH v3 0/7] x86,tlb,mm: make lazy TLB mode even lazier Dave Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).