* [PATCH] add cpu_relax() in spin loops
@ 2004-11-10 3:35 Fenghua Yu
0 siblings, 0 replies; only message in thread
From: Fenghua Yu @ 2004-11-10 3:35 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 222 bytes --]
This patch adds cpu_relax() in the body of spin loops in
smp_call_function(), smp_call_function_single(), and
ia64_mca_wakeup_ipi_wait().
The patch is against the latest linux-ia64-test-2.6.10
bk tree.
Thanks.
-Fenghua
[-- Attachment #2: spin_loops_ia64.patch --]
[-- Type: text/plain, Size: 1049 bytes --]
--- a/arch/ia64/kernel/mca.c 2004-10-26 11:52:44.000000000 -0700
+++ b/arch/ia64/kernel/mca.c 2004-10-28 14:07:12.000000000 -0700
@@ -686,6 +686,7 @@ ia64_mca_wakeup_ipi_wait(void)
irr = ia64_getreg(_IA64_REG_CR_IRR3);
break;
}
+ cpu_relax();
} while (!(irr & (1UL << irr_bit))) ;
}
--- a/arch/ia64/kernel/smp.c 2004-10-26 11:52:44.000000000 -0700
+++ b/arch/ia64/kernel/smp.c 2004-10-28 14:08:21.000000000 -0700
@@ -290,11 +290,11 @@ smp_call_function_single (int cpuid, voi
/* Wait for response */
while (atomic_read(&data.started) != cpus)
- barrier();
+ cpu_relax();
if (wait)
while (atomic_read(&data.finished) != cpus)
- barrier();
+ cpu_relax();
call_data = NULL;
spin_unlock_bh(&call_lock);
@@ -349,11 +349,11 @@ smp_call_function (void (*func) (void *i
/* Wait for response */
while (atomic_read(&data.started) != cpus)
- barrier();
+ cpu_relax();
if (wait)
while (atomic_read(&data.finished) != cpus)
- barrier();
+ cpu_relax();
call_data = NULL;
spin_unlock(&call_lock);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-11-10 3:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-10 3:35 [PATCH] add cpu_relax() in spin loops Fenghua Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox