Commit 74f06293 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: Use for_each_cpu_mask for clustered IPI flush

Makes it slightly more efficient.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent acc7b6f0
...@@ -82,30 +82,27 @@ static inline void send_IPI_mask_sequence(cpumask_t mask, int vector) ...@@ -82,30 +82,27 @@ static inline void send_IPI_mask_sequence(cpumask_t mask, int vector)
*/ */
local_irq_save(flags); local_irq_save(flags);
for (query_cpu = 0; query_cpu < NR_CPUS; ++query_cpu) { for_each_cpu_mask(query_cpu, mask) {
if (cpu_isset(query_cpu, mask)) { /*
* Wait for idle.
/* */
* Wait for idle. apic_wait_icr_idle();
*/
apic_wait_icr_idle(); /*
* prepare target chip field
/* */
* prepare target chip field cfg = __prepare_ICR2(x86_cpu_to_apicid[query_cpu]);
*/ apic_write_around(APIC_ICR2, cfg);
cfg = __prepare_ICR2(x86_cpu_to_apicid[query_cpu]);
apic_write_around(APIC_ICR2, cfg); /*
* program the ICR
/* */
* program the ICR cfg = __prepare_ICR(0, vector, APIC_DEST_PHYSICAL);
*/
cfg = __prepare_ICR(0, vector, APIC_DEST_PHYSICAL); /*
* Send the IPI. The write to APIC_ICR fires this off.
/* */
* Send the IPI. The write to APIC_ICR fires this off. apic_write_around(APIC_ICR, cfg);
*/
apic_write_around(APIC_ICR, cfg);
}
} }
local_irq_restore(flags); local_irq_restore(flags);
} }
......
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