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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ashok Raj <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux