Re: [patch 4/5] try2: x86_64: Dont use broadcast shortcut to makeit cpu hotplug safe.

From: Andrew Morton
Date: Mon Jun 06 2005 - 17:18:19 EST


Ashok Raj <ashok.raj@xxxxxxxxx> wrote:
>
> +static void flat_send_IPI_allbutself(int vector)
> +{
> + cpumask_t mask;
> + /*
> + * if there are no other CPUs in the system then
> + * we get an APIC send error if we try to broadcast.
> + * thus we have to avoid sending IPIs in this case.
> + */
> + get_cpu();
> + mask = cpu_online_map;
> + cpu_clear(smp_processor_id(), mask);
> +
> + if (cpus_weight(mask) >= 1)
> + flat_send_IPI_mask(mask, vector);
> +
> + put_cpu();
> +}

It would be more idiomatic to use preempt_disable() and preempt_enable() in
place of get_cpu() and put_cpu() here.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/