Commit 67382f14 authored by Martin J. Bligh's avatar Martin J. Bligh Committed by Patrick Mochel

[PATCH] clustered IPI cleanups

This one fixes up the IPI code to do something more sensible.  Sorry,
was just too ugly to leave it alone ...  but I did keep it seperated out
;-) Though this is not an equivalent transform it will only affect
NUMA-Q & summit - same op twice because some twit just split it out in
the last patch for both NUMA-Q & Summit.

Because clustered apic logical mode can't do arbitrary broadcasts of
addressing (it's not just a bitmap), I have to do send IPI instructions
as a sequence of unicasts.  However, there's already a loop in the
generic send_IPI_mask code to do that ...  there's no need to call
send_IPI_mask once for each CPU.  The comment I wrote at the time even
noted that this was silly.
parent 00047bcc
...@@ -10,30 +10,15 @@ static inline void send_IPI_mask(int mask, int vector) ...@@ -10,30 +10,15 @@ static inline void send_IPI_mask(int mask, int vector)
static inline void send_IPI_allbutself(int vector) static inline void send_IPI_allbutself(int vector)
{ {
int cpu; unsigned long mask = cpu_online_map & ~(1 << smp_processor_id());
/*
* if there are no other CPUs in the system then we get an APIC send
* error if we try to broadcast, thus avoid sending IPIs in this case.
*/
if (!(num_online_cpus() > 1))
return;
/* Pointless. Use send_IPI_mask to do this instead */ if (mask)
for (cpu = 0; cpu < NR_CPUS; ++cpu) send_IPI_mask(mask, vector);
if (cpu_online(cpu) && cpu != smp_processor_id())
send_IPI_mask(1 << cpu, vector);
return;
} }
static inline void send_IPI_all(int vector) static inline void send_IPI_all(int vector)
{ {
int cpu; send_IPI_mask(cpu_online_map, vector);
/* Pointless. Use send_IPI_mask to do this instead */
for (cpu = 0; cpu < NR_CPUS; ++cpu)
if (cpu_online(cpu))
send_IPI_mask(1 << cpu, vector);
} }
#endif /* __ASM_MACH_IPI_H */ #endif /* __ASM_MACH_IPI_H */
...@@ -10,30 +10,15 @@ static inline void send_IPI_mask(int mask, int vector) ...@@ -10,30 +10,15 @@ static inline void send_IPI_mask(int mask, int vector)
static inline void send_IPI_allbutself(int vector) static inline void send_IPI_allbutself(int vector)
{ {
int cpu; unsigned long mask = cpu_online_map & ~(1 << smp_processor_id());
/*
* if there are no other CPUs in the system then we get an APIC send
* error if we try to broadcast, thus avoid sending IPIs in this case.
*/
if (!(num_online_cpus() > 1))
return;
/* Pointless. Use send_IPI_mask to do this instead */ if (mask)
for (cpu = 0; cpu < NR_CPUS; ++cpu) send_IPI_mask(mask, vector);
if (cpu_online(cpu) && cpu != smp_processor_id())
send_IPI_mask(1 << cpu, vector);
return;
} }
static inline void send_IPI_all(int vector) static inline void send_IPI_all(int vector)
{ {
int cpu; send_IPI_mask(cpu_online_map, vector);
/* Pointless. Use send_IPI_mask to do this instead */
for (cpu = 0; cpu < NR_CPUS; ++cpu)
if (cpu_online(cpu))
send_IPI_mask(1 << cpu, vector);
} }
#endif /* __ASM_MACH_IPI_H */ #endif /* __ASM_MACH_IPI_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment