aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-07-29 00:15:41 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-29 00:46:01 -0400
commit37a47e65fa58d413a31f27ee88f6cb98583b6157 (patch)
tree4c9cc88e9816f174d379d3c0f8066aa78163809f /arch
parent5f68c1388ada34998c2902c289c6a6b625a73c4e (diff)
[PATCH] x86_64: Remove the broadcast options that were added for cpuhotplug
Will be obsolete with physflat. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/kernel/genapic_flat.c88
1 files changed, 2 insertions, 86 deletions
diff --git a/arch/x86_64/kernel/genapic_flat.c b/arch/x86_64/kernel/genapic_flat.c
index 282846965080..fdfa15f5d2ed 100644
--- a/arch/x86_64/kernel/genapic_flat.c
+++ b/arch/x86_64/kernel/genapic_flat.c
@@ -7,8 +7,6 @@
7 * Hacked for x86-64 by James Cleverdon from i386 architecture code by 7 * Hacked for x86-64 by James Cleverdon from i386 architecture code by
8 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and 8 * Martin Bligh, Andi Kleen, James Bottomley, John Stultz, and
9 * James Cleverdon. 9 * James Cleverdon.
10 * Ashok Raj <ashok.raj@intel.com>
11 * Removed IPI broadcast shortcut to support CPU hotplug
12 */ 10 */
13#include <linux/config.h> 11#include <linux/config.h>
14#include <linux/threads.h> 12#include <linux/threads.h>
@@ -20,47 +18,6 @@
20#include <asm/smp.h> 18#include <asm/smp.h>
21#include <asm/ipi.h> 19#include <asm/ipi.h>
22 20
23/*
24 * The following permit choosing broadcast IPI shortcut v.s sending IPI only
25 * to online cpus via the send_IPI_mask varient.
26 * The mask version is my preferred option, since it eliminates a lot of
27 * other extra code that would need to be written to cleanup intrs sent
28 * to a CPU while offline.
29 *
30 * Sending broadcast introduces lots of trouble in CPU hotplug situations.
31 * These IPI's are delivered to cpu's irrespective of their offline status
32 * and could pickup stale intr data when these CPUS are turned online.
33 *
34 * Not using broadcast is a cleaner approach IMO, but Andi Kleen disagrees with
35 * the idea of not using broadcast IPI's anymore. Hence the run time check
36 * is introduced, on his request so we can choose an alternate mechanism.
37 *
38 * Initial wacky performance tests that collect cycle counts show
39 * no increase in using mask v.s broadcast version. In fact they seem
40 * identical in terms of cycle counts.
41 *
42 * if we need to use broadcast, we need to do the following.
43 *
44 * cli;
45 * hold call_lock;
46 * clear any pending IPI, just ack and clear all pending intr
47 * set cpu_online_map;
48 * release call_lock;
49 * sti;
50 *
51 * The complicated dummy irq processing shown above is not required if
52 * we didnt sent IPI's to wrong CPU's in the first place.
53 *
54 * - Ashok Raj <ashok.raj@intel.com>
55 */
56#ifdef CONFIG_HOTPLUG_CPU
57#define DEFAULT_SEND_IPI (1)
58#else
59#define DEFAULT_SEND_IPI (0)
60#endif
61
62static int no_broadcast=DEFAULT_SEND_IPI;
63
64static cpumask_t flat_target_cpus(void) 21static cpumask_t flat_target_cpus(void)
65{ 22{
66 return cpu_online_map; 23 return cpu_online_map;
@@ -119,37 +76,15 @@ static void flat_send_IPI_mask(cpumask_t cpumask, int vector)
119 local_irq_restore(flags); 76 local_irq_restore(flags);
120} 77}
121 78
122static inline void __local_flat_send_IPI_allbutself(int vector)
123{
124 if (no_broadcast) {
125 cpumask_t mask = cpu_online_map;
126 int this_cpu = get_cpu();
127
128 cpu_clear(this_cpu, mask);
129 flat_send_IPI_mask(mask, vector);
130 put_cpu();
131 }
132 else
133 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL);
134}
135
136static inline void __local_flat_send_IPI_all(int vector)
137{
138 if (no_broadcast)
139 flat_send_IPI_mask(cpu_online_map, vector);
140 else
141 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
142}
143
144static void flat_send_IPI_allbutself(int vector) 79static void flat_send_IPI_allbutself(int vector)
145{ 80{
146 if (((num_online_cpus()) - 1) >= 1) 81 if (((num_online_cpus()) - 1) >= 1)
147 __local_flat_send_IPI_allbutself(vector); 82 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL);
148} 83}
149 84
150static void flat_send_IPI_all(int vector) 85static void flat_send_IPI_all(int vector)
151{ 86{
152 __local_flat_send_IPI_all(vector); 87 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
153} 88}
154 89
155static int flat_apic_id_registered(void) 90static int flat_apic_id_registered(void)
@@ -170,16 +105,6 @@ static unsigned int phys_pkg_id(int index_msb)
170 return ((ebx >> 24) & 0xFF) >> index_msb; 105 return ((ebx >> 24) & 0xFF) >> index_msb;
171} 106}
172 107
173static __init int no_ipi_broadcast(char *str)
174{
175 get_option(&str, &no_broadcast);
176 printk ("Using %s mode\n", no_broadcast ? "No IPI Broadcast" :
177 "IPI Broadcast");
178 return 1;
179}
180
181__setup("no_ipi_broadcast", no_ipi_broadcast);
182
183struct genapic apic_flat = { 108struct genapic apic_flat = {
184 .name = "flat", 109 .name = "flat",
185 .int_delivery_mode = dest_LowestPrio, 110 .int_delivery_mode = dest_LowestPrio,
@@ -194,12 +119,3 @@ struct genapic apic_flat = {
194 .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, 119 .cpu_mask_to_apicid = flat_cpu_mask_to_apicid,
195 .phys_pkg_id = phys_pkg_id, 120 .phys_pkg_id = phys_pkg_id,
196}; 121};
197
198static int __init print_ipi_mode(void)
199{
200 printk ("Using IPI %s mode\n", no_broadcast ? "No-Shortcut" :
201 "Shortcut");
202 return 0;
203}
204
205late_initcall(print_ipi_mode);