From: "Andi Kleen" Makes it slightly more efficient. Signed-off-by: Andi Kleen Signed-off-by: Andrew Morton --- include/asm-x86_64/ipi.h | 45 +++++++++++++++++++++------------------------ 1 files changed, 21 insertions(+), 24 deletions(-) diff -puN include/asm-x86_64/ipi.h~x86_64-use-for_each_cpu_mask-for-clustered-ipi-flush include/asm-x86_64/ipi.h --- devel/include/asm-x86_64/ipi.h~x86_64-use-for_each_cpu_mask-for-clustered-ipi-flush 2005-07-27 12:36:03.000000000 -0700 +++ devel-akpm/include/asm-x86_64/ipi.h 2005-07-27 12:36:03.000000000 -0700 @@ -82,30 +82,27 @@ static inline void send_IPI_mask_sequenc */ local_irq_save(flags); - for (query_cpu = 0; query_cpu < NR_CPUS; ++query_cpu) { - if (cpu_isset(query_cpu, mask)) { - - /* - * Wait for idle. - */ - apic_wait_icr_idle(); - - /* - * prepare target chip field - */ - cfg = __prepare_ICR2(x86_cpu_to_apicid[query_cpu]); - apic_write_around(APIC_ICR2, cfg); - - /* - * program the ICR - */ - cfg = __prepare_ICR(0, vector, APIC_DEST_PHYSICAL); - - /* - * Send the IPI. The write to APIC_ICR fires this off. - */ - apic_write_around(APIC_ICR, cfg); - } + for_each_cpu_mask(query_cpu, mask) { + /* + * Wait for idle. + */ + apic_wait_icr_idle(); + + /* + * prepare target chip field + */ + cfg = __prepare_ICR2(x86_cpu_to_apicid[query_cpu]); + apic_write_around(APIC_ICR2, cfg); + + /* + * program the ICR + */ + cfg = __prepare_ICR(0, vector, APIC_DEST_PHYSICAL); + + /* + * Send the IPI. The write to APIC_ICR fires this off. + */ + apic_write_around(APIC_ICR, cfg); } local_irq_restore(flags); } _