diff options
author | Ashok Raj <ashok.raj@intel.com> | 2005-06-25 17:54:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:24:29 -0400 |
commit | 67664c8f7e74def5adf66298a1245d82af72db2c (patch) | |
tree | c98657d833d3ca61322a8ae54023814ebc36a480 | |
parent | f370513640492641b4046bfd9a6e4714f6ae530d (diff) |
[PATCH] i386: Dont use IPI broadcast when using cpu hotplug.
This patch introduces a startup parameter no_broadcast. When we enable
CONFIG_HOTPLUG_CPU, we dont want to use broadcast shortcut as it has ill
effects on a offline cpu. If we issue broadcast, the IPI is also delivered
to offline cpus, or partially up cpu causing stale IPI's to be handled,
which is a problem and can cause undesirable effects.
Introduces a new startup cmdline option no_ipi_broadcast, that can be
switched at cmdline if necessary.
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Acked-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/i386/mach-default/setup.c | 27 | ||||
-rw-r--r-- | include/asm-i386/mach-default/mach_ipi.h | 27 |
2 files changed, 52 insertions, 2 deletions
diff --git a/arch/i386/mach-default/setup.c b/arch/i386/mach-default/setup.c index 0aa08eaa8932..e5a1a83d09ef 100644 --- a/arch/i386/mach-default/setup.c +++ b/arch/i386/mach-default/setup.c | |||
@@ -10,6 +10,14 @@ | |||
10 | #include <asm/acpi.h> | 10 | #include <asm/acpi.h> |
11 | #include <asm/arch_hooks.h> | 11 | #include <asm/arch_hooks.h> |
12 | 12 | ||
13 | #ifdef CONFIG_HOTPLUG_CPU | ||
14 | #define DEFAULT_SEND_IPI (1) | ||
15 | #else | ||
16 | #define DEFAULT_SEND_IPI (0) | ||
17 | #endif | ||
18 | |||
19 | int no_broadcast=DEFAULT_SEND_IPI; | ||
20 | |||
13 | /** | 21 | /** |
14 | * pre_intr_init_hook - initialisation prior to setting up interrupt vectors | 22 | * pre_intr_init_hook - initialisation prior to setting up interrupt vectors |
15 | * | 23 | * |
@@ -104,3 +112,22 @@ void __init mca_nmi_hook(void) | |||
104 | printk("NMI generated from unknown source!\n"); | 112 | printk("NMI generated from unknown source!\n"); |
105 | } | 113 | } |
106 | #endif | 114 | #endif |
115 | |||
116 | static __init int no_ipi_broadcast(char *str) | ||
117 | { | ||
118 | get_option(&str, &no_broadcast); | ||
119 | printk ("Using %s mode\n", no_broadcast ? "No IPI Broadcast" : | ||
120 | "IPI Broadcast"); | ||
121 | return 1; | ||
122 | } | ||
123 | |||
124 | __setup("no_ipi_broadcast", no_ipi_broadcast); | ||
125 | |||
126 | static int __init print_ipi_mode(void) | ||
127 | { | ||
128 | printk ("Using IPI %s mode\n", no_broadcast ? "No-Shortcut" : | ||
129 | "Shortcut"); | ||
130 | return 0; | ||
131 | } | ||
132 | |||
133 | late_initcall(print_ipi_mode); | ||
diff --git a/include/asm-i386/mach-default/mach_ipi.h b/include/asm-i386/mach-default/mach_ipi.h index 6f2b17a20089..cc756a67cd63 100644 --- a/include/asm-i386/mach-default/mach_ipi.h +++ b/include/asm-i386/mach-default/mach_ipi.h | |||
@@ -4,11 +4,34 @@ | |||
4 | void send_IPI_mask_bitmask(cpumask_t mask, int vector); | 4 | void send_IPI_mask_bitmask(cpumask_t mask, int vector); |
5 | void __send_IPI_shortcut(unsigned int shortcut, int vector); | 5 | void __send_IPI_shortcut(unsigned int shortcut, int vector); |
6 | 6 | ||
7 | extern int no_broadcast; | ||
8 | |||
7 | static inline void send_IPI_mask(cpumask_t mask, int vector) | 9 | static inline void send_IPI_mask(cpumask_t mask, int vector) |
8 | { | 10 | { |
9 | send_IPI_mask_bitmask(mask, vector); | 11 | send_IPI_mask_bitmask(mask, vector); |
10 | } | 12 | } |
11 | 13 | ||
14 | static inline void __local_send_IPI_allbutself(int vector) | ||
15 | { | ||
16 | if (no_broadcast) { | ||
17 | cpumask_t mask = cpu_online_map; | ||
18 | int this_cpu = get_cpu(); | ||
19 | |||
20 | cpu_clear(this_cpu, mask); | ||
21 | send_IPI_mask(mask, vector); | ||
22 | put_cpu(); | ||
23 | } else | ||
24 | __send_IPI_shortcut(APIC_DEST_ALLBUT, vector); | ||
25 | } | ||
26 | |||
27 | static inline void __local_send_IPI_all(int vector) | ||
28 | { | ||
29 | if (no_broadcast) | ||
30 | send_IPI_mask(cpu_online_map, vector); | ||
31 | else | ||
32 | __send_IPI_shortcut(APIC_DEST_ALLINC, vector); | ||
33 | } | ||
34 | |||
12 | static inline void send_IPI_allbutself(int vector) | 35 | static inline void send_IPI_allbutself(int vector) |
13 | { | 36 | { |
14 | /* | 37 | /* |
@@ -18,13 +41,13 @@ static inline void send_IPI_allbutself(int vector) | |||
18 | if (!(num_online_cpus() > 1)) | 41 | if (!(num_online_cpus() > 1)) |
19 | return; | 42 | return; |
20 | 43 | ||
21 | __send_IPI_shortcut(APIC_DEST_ALLBUT, vector); | 44 | __local_send_IPI_allbutself(vector); |
22 | return; | 45 | return; |
23 | } | 46 | } |
24 | 47 | ||
25 | static inline void send_IPI_all(int vector) | 48 | static inline void send_IPI_all(int vector) |
26 | { | 49 | { |
27 | __send_IPI_shortcut(APIC_DEST_ALLINC, vector); | 50 | __local_send_IPI_all(vector); |
28 | } | 51 | } |
29 | 52 | ||
30 | #endif /* __ASM_MACH_IPI_H */ | 53 | #endif /* __ASM_MACH_IPI_H */ |