[patch 4/4] CPU hot-plug support for x86_64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch removes the usage of shortcut to send smp_call_function using ALL_BUT_SELF 
shortcut.  This is a problem for an upcomming CPU, and is still not ready to take
this interrupt. Since cpu_online_map is updated with the call_lock held, this 
mechanism should avoid sending IPI to cpu's not yet prepared to participate in this
party.

Signed-off-by: Ashok Raj <[email protected]>
----------------------------------------
 smp.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

Index: linux-2.6.12-rc4-mm2/arch/x86_64/kernel/smp.c
===================================================================
--- linux-2.6.12-rc4-mm2.orig/arch/x86_64/kernel/smp.c	2005-05-20 13:14:27.000000000 -0700
+++ linux-2.6.12-rc4-mm2/arch/x86_64/kernel/smp.c	2005-05-20 13:14:38.000000000 -0700
@@ -315,8 +315,10 @@
 				int nonatomic, int wait)
 {
 	struct call_data_struct data;
-	int cpus = num_online_cpus()-1;
+	cpumask_t cpu_mask;
+	int cpus;
 
+	cpus = num_online_cpus() - 1;
 	if (!cpus)
 		return;
 
@@ -327,10 +329,14 @@
 	if (wait)
 		atomic_set(&data.finished, 0);
 
+	cpu_mask = cpu_online_map;
+	cpu_clear(smp_processor_id(), cpu_mask);
+
 	call_data = &data;
 	wmb();
+
 	/* Send a message to all other CPUs and wait for them to respond */
-	send_IPI_allbutself(CALL_FUNCTION_VECTOR);
+	send_IPI_mask(cpu_mask, CALL_FUNCTION_VECTOR);
 
 	/* Wait for response */
 	while (atomic_read(&data.started) != cpus)

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux