Files
linux-kernel-test/arch/x86/include/asm
Shaohua Li 70e4a36973 x86: Scale up the number of TLB invalidate vectors with NR_CPUs, up to 32
Make the maxium TLB invalidate vectors depend on NR_CPUS linearly,
with a maximum of 32 vectors.

We currently only have 8 vectors for TLB invalidation and that is clearly
inadequate. If we have a lot of CPUs, the CPUs need share the 8 vectors and
tlbstate_lock is used to protect them. flush_tlb_page() is
heavily used in page reclaim, which will cause a lot of lock
contention for tlbstate_lock.

Andi Kleen suggested increasing the vectors number to 32, which should be
good for current typical systems to reduce the tlbstate_lock contention.

My test system has 4 sockets and 64G memory, and 64 CPUs. My
workload creates 64 processes. Each process mmap reads a big
empty sparse file. The total size of the files are 2*total_mem,
so this will cause a lot of page reclaim.

Below is the result I get from perf call-graph profiling:

 without the patch:
 ------------------

    24.25%           usemem  [kernel]                                   [k] _raw_spin_lock
                     |
                     --- _raw_spin_lock
                        |
                        |--42.15%-- native_flush_tlb_others

 with the patch:
 ------------------

    14.96%           usemem  [kernel]                                   [k] _raw_spin_lock
                     |
                     --- _raw_spin_lock
                        |--13.89%-- native_flush_tlb_others

So this heavily reduces the tlbstate_lock contention.

Suggested-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1295232727.1949.709.camel@sli10-conroe>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2011-02-14 13:03:08 +01:00
..
2011-01-13 08:03:25 -08:00
2010-11-12 00:45:41 +01:00
2009-12-05 09:10:12 -08:00
2011-01-21 14:11:12 +01:00
2010-02-16 21:22:26 -08:00
2010-10-26 16:52:08 -07:00
2010-05-07 17:13:04 -07:00
2011-01-07 10:03:50 -05:00
2010-03-10 13:23:34 +01:00
2010-10-26 16:52:08 -07:00
2010-10-07 14:08:55 +01:00
2010-08-14 22:26:51 +02:00
2011-01-07 15:08:53 +01:00
2011-01-13 17:32:46 -08:00
2010-06-09 11:12:36 +02:00
2010-01-05 15:34:49 +09:00
2010-06-29 12:12:59 +02:00
2010-05-07 17:13:04 -07:00
2011-01-07 15:08:52 +01:00
2010-06-29 12:12:59 +02:00
2011-01-13 17:32:39 -08:00
2011-01-26 10:49:57 +10:00
2010-11-18 12:52:04 +01:00
2011-01-26 08:10:49 +01:00
2010-11-01 15:38:34 -04:00
2010-10-26 16:52:08 -07:00
2011-01-13 17:32:44 -08:00
2011-01-13 17:32:44 -08:00
2011-01-13 17:32:44 -08:00
2011-01-13 17:32:44 -08:00
2010-12-15 17:11:30 -08:00
2010-02-12 09:42:39 -08:00
2010-07-20 17:41:14 -07:00
2010-11-12 00:45:41 +01:00
2011-01-12 11:23:16 +02:00
2010-10-18 10:49:34 -04:00