x86: udelay: Use this_cpu_read to avoid address calculation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Christoph Lameter
Date: Thursday, December 16, 2010 - 11:14 am

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

Signed-off-by: Christoph Lameter <cl@linux.com>

---
 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);
 }

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[cpuops cmpxchg V2 5/5] cpuops: Use cmpxchg for xchg to av ..., Christoph Lameter, (Tue Dec 14, 9:28 am)
Re: [cpuops cmpxchg V2 5/5] cpuops: Use cmpxchg for xchg t ..., Mathieu Desnoyers, (Tue Dec 14, 9:35 am)
Re: [cpuops cmpxchg V2 5/5] cpuops: Use cmpxchg for xchg t ..., Christoph Lameter, (Tue Dec 14, 9:55 am)
Re: [cpuops cmpxchg V2 5/5] cpuops: Use cmpxchg for xchg t ..., Christoph Lameter, (Tue Dec 14, 10:19 am)
Re: [cpuops cmpxchg V2 5/5] cpuops: Use cmpxchg for xchg t ..., Christoph Lameter, (Tue Dec 14, 10:35 am)
x86: Use this_cpu_has for thermal_interrupt, Christoph Lameter, (Thu Dec 16, 11:13 am)
x86: udelay: Use this_cpu_read to avoid address calculation, Christoph Lameter, (Thu Dec 16, 11:14 am)
gameport: use this_cpu_read instead of lookup, Christoph Lameter, (Thu Dec 16, 11:15 am)
acpi throttling: Use this_cpu_has and simplify code, Christoph Lameter, (Thu Dec 16, 11:16 am)
Re: gameport: use this_cpu_read instead of lookup, Tejun Heo, (Sat Dec 18, 8:34 am)
Re: x86: Use this_cpu_has for thermal_interrupt, Tejun Heo, (Sat Dec 18, 8:35 am)
Re: x86: Use this_cpu_has for thermal_interrupt, H. Peter Anvin, (Mon Dec 20, 5:56 pm)
Re: acpi throttling: Use this_cpu_has and simplify code, Christoph Lameter, (Tue Dec 21, 3:43 pm)
Re: x86: Use this_cpu_has for thermal_interrupt, Tejun Heo, (Thu Dec 30, 4:29 am)
Re: x86: Use this_cpu_has for thermal_interrupt, H. Peter Anvin, (Thu Dec 30, 11:19 am)
Re: x86: Use this_cpu_has for thermal_interrupt, Tejun Heo, (Fri Dec 31, 5:43 am)