Re: [PATCH 4/7] SMP: Implement on_one_cpu()

Roland Dreier
2007-05-24T13:43:48Z

I don't see any documented restrictions about preemption being
disabled when this function is called, but...

> +int on_one_cpu(int cpu, void (*func) (void *info), void *info,
> + int retry, int wait)
> +{
> + int ret;
> + int this_cpu;
> +
> + this_cpu = get_cpu();

what if a preempt and reschedule to a different CPU happens right
here, after this_cpu is set?

> + if (this_cpu == cpu) {