x86: udelay: Use this_cpu_read to avoid address calculation

From: Christoph Lameter
Date: Thu Dec 16 2010 - 13:14:55 EST


The code will use a segment prefix instead of doing the lookup and calculation.

Signed-off-by: Christoph Lameter <cl@xxxxxxxxx>

---
arch/x86/lib/delay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/arch/x86/lib/delay.c
===================================================================
--- linux-2.6.orig/arch/x86/lib/delay.c 2010-12-16 11:45:12.000000000 -0600
+++ linux-2.6/arch/x86/lib/delay.c 2010-12-16 11:45:37.000000000 -0600
@@ -121,7 +121,7 @@ inline void __const_udelay(unsigned long
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);
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/