x86: Avoid tlbstate lock if not enough cpus
authorShaohua Li <shaohua.li@intel.com>
Mon, 17 Jan 2011 02:52:10 +0000 (10:52 +0800)
committerIngo Molnar <mingo@elte.hu>
Mon, 14 Feb 2011 12:03:08 +0000 (13:03 +0100)
commit7064d865af804b9b841e7b9a3e9b653e40c3e5ca
tree7f4afcd7f3d9a767fe232b5455a8550c418c2898
parent70e4a369733a21e3d16b059a6ccdad22a344bf57
x86: Avoid tlbstate lock if not enough cpus

This one isn't related to previous patch. If online cpus are
below NUM_INVALIDATE_TLB_VECTORS, we don't need the lock. The
comments in the code declares we don't need the check, but a hot
lock still needs an atomic operation and expensive, so add the
check here.

Uses nr_cpu_ids here as suggested by Eric Dumazet.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>
LKML-Reference: <1295232730.1949.710.camel@sli10-conroe>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/mm/tlb.c