OSDN Git Service

x86: udelay: Use this_cpu_read to avoid address calculation
authorChristoph Lameter <cl@linux.com>
Thu, 16 Dec 2010 18:14:43 +0000 (12:14 -0600)
committerTejun Heo <tj@kernel.org>
Tue, 4 Jan 2011 05:08:55 +0000 (06:08 +0100)
The code will use a segment prefix instead of doing the lookup and
calculation.

Signed-off-by: Christoph Lameter <cl@linux.com>
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
arch/x86/lib/delay.c

index ff485d3..fc45ba8 100644 (file)
@@ -121,7 +121,7 @@ inline void __const_udelay(unsigned long xloops)
        asm("mull %%edx"
                :"=d" (xloops), "=&a" (d0)
                :"1" (xloops), "0"
-               (cpu_data(raw_smp_processor_id()).loops_per_jiffy * (HZ/4)));
+               (this_cpu_read(cpu_info.loops_per_jiffy) * (HZ/4)));
 
        __delay(++xloops);
 }