[PATCH 45/52] use wait_for_init_deassert in x86_64

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>
Cc: <akpm@...>, <glommer@...>, <mingo@...>, <tglx@...>, Glauber Costa <gcosta@...>
Date: Monday, March 3, 2008 - 1:13 pm

wraps the busy loop for wait_for_init_deasserted() in a function,
so smp_callin in x86_64 looks like more i386

Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
 arch/x86/kernel/smpboot_64.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index 9f4935e..4f6d976 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -100,6 +100,13 @@ static void __cpuinit smp_store_cpu_info(int id)
 	print_cpu_info(c);
 }
 
+static inline void wait_for_init_deassert(atomic_t *deassert)
+{
+	while (!atomic_read(deassert))
+		cpu_relax();
+	return;
+}
+
 static atomic_t init_deasserted __cpuinitdata;
 
 /*
@@ -117,8 +124,7 @@ void __cpuinit smp_callin(void)
 	 * our local APIC.  We have to wait for the IPI or we'll
 	 * lock up on an APIC access.
 	 */
-	while (!atomic_read(&init_deasserted))
-		cpu_relax();
+	wait_for_init_deassert(&init_deasserted);
 
 	/*
 	 * (This works even if the APIC is not enabled.)
-- 
1.5.0.6

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

Messages in current thread:
[PATCH 38/52] do not clear cpu_online_map, Glauber Costa, (Mon Mar 3, 1:13 pm)
[PATCH 39/52] merge __cpu_disable and cpu_die, Glauber Costa, (Mon Mar 3, 1:13 pm)
[PATCH 40/52] make x86_64 accept the max_cpus parameter, Glauber Costa, (Mon Mar 3, 1:13 pm)
[PATCH 42/52] adapt voyager's trampoline_base, Glauber Costa, (Mon Mar 3, 1:13 pm)
[PATCH 43/52] adapt voyager's setup_trampoline, Glauber Costa, (Mon Mar 3, 1:13 pm)
[PATCH 44/52] unify setup_trampoline, Glauber Costa, (Mon Mar 3, 1:13 pm)
[PATCH 45/52] use wait_for_init_deassert in x86_64, Glauber Costa, (Mon Mar 3, 1:13 pm)
[PATCH 46/52] use cpu_relax instead of rep_nop, Glauber Costa, (Mon Mar 3, 1:13 pm)
[PATCH 50/52] provide an end_local_APIC_setup function, Glauber Costa, (Mon Mar 3, 1:13 pm)