x86, tlb, UV: Do small micro-optimization for native_flush_tlb_others()
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Tue, 15 Mar 2011 01:57:37 +0000 (09:57 +0800)
committerIngo Molnar <mingo@elte.hu>
Tue, 15 Mar 2011 07:30:34 +0000 (08:30 +0100)
native_flush_tlb_others() is called from:

 flush_tlb_current_task()
 flush_tlb_mm()
 flush_tlb_page()

All these functions disable preemption explicitly, so we can use
smp_processor_id() instead of get_cpu() and put_cpu().

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: Cliff Wickman <cpw@sgi.com>
LKML-Reference: <4D7EC791.4040003@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/mm/tlb.c

index 55272d7c3b0b2a820c7b82e30f20c748ab52f7e1..d6c0418c3e4711795158b52e57b2fa337848d03c 100644 (file)
@@ -208,11 +208,10 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
        if (is_uv_system()) {
                unsigned int cpu;
 
-               cpu = get_cpu();
+               cpu = smp_processor_id();
                cpumask = uv_flush_tlb_others(cpumask, mm, va, cpu);
                if (cpumask)
                        flush_tlb_others_ipi(cpumask, mm, va);
-               put_cpu();
                return;
        }
        flush_tlb_others_ipi(cpumask, mm, va);