[RFC][PATCH 1/5] x86: Remove const_udelay() caring about which cpu var it uses

Steven Rostedt
2011-09-19T21:26:50Z

[-- Attachment #1: 0001-x86-Remove-const_udelay-caring-about-which-cpu-var-i.patch --]
[-- Type: text/plain, Size: 998 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

The __const_udelay() code originally used raw_smp_processor_id()
in its calculations for a delaying. Probably because if it were
to migrate, it would take much longer to do so than the requested
delay.

Switch from this_cpu_read() to __this_cpu_read() to document that
the read is racy and we do not care.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
arch/x86/lib/delay.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/lib/delay.c b/arch/x86/lib/delay.c
index fc45ba8..1b9bde5 100644
--- a/arch/x86/lib/delay.c
+++ b/arch/x86/lib/delay.c
@@ -121,7 +121,7 @@ inline void __const_udelay(unsigned long xloops)
asm("mull %%edx"
:"=d" (xloops), "=&a" (d0)
:"1" (xloops), "0"
- (this_cpu_read(cpu_info.loops_per_jiffy) * (HZ/4)));
+ (__this_cpu_read(cpu_info.loops_per_jiffy) * (HZ/4)));

__delay(++xloops);
}
--
1.7.5.4