Re: Bug in on_each_cpu?

Zachary Amsden
2007-03-01T20:31:35Z

Andrew Morton wrote:
> The handler for smp_call_function() is called with local interrupts
> disabled (from the IPI handler).
>
> So to provide a consistent call environment for that handler, on_each_cpu()
> will also disable local interrupts when making the direct call on this CPU.
>
> Similarly the !CONFIG_SMP version of on_each_cpu() disables local
> interrupts when running the caller's function.
>

Yes, that is sensible. Something akin to on_each_cpu(synchronize_tscs)
would certainly not like interrupts coming in. Similarly, acpi_nmi
disable and probably rcu barriers as well. The irq disable here can
very validly be used as a barrier, but trying to ensure preserved shared
state with irq handlers over the call is a bug.

If one had all the spare time in the world, a new "sense" of irq disable
that communicated this fact would be nice from a static or dynamic
checking perspective.

Zach

------
sutra I.1 - atha linushasaanam