On Sun, 28 May 2006 00:20:30 -0400
Kumba <kumba@gentoo.org> wrote:
> > suggest you should open-code an smp_call_function() and put a big comment
> > over it explaining why it's done this way, and why it isn't deadlocky.
> >
> > <tries to remember what the deadlock is>
> >
> > If CPU A is running smp_call_function() it's waiting for CPU B to run the
> > handler.
> >
> > But if CPU B is presently _also_ running smp_call_function(), it's waiting
> > for CPU A to run the handler.
> >
> > If either of those CPUs is waiting for the other with local interrupts
> > disabled, that CPU will never respond to the other CPU's IPI and they'll
> > deadlock.
>
> The catch is, the system being affected here is strictly a UP machine. It's
> impossible to make an O2 go SMP.
Yup. But again, the reasons for that change to on_each_cpu() were to make
all instances of the the callback function run under the same environment
in all cases. That's a good change.
If the platform _knows_ that it's safe to do normally-unsafe things then as
I say, it shold special-case that case.
Here, if the call is in O2-only code then we don't need on_each_cpu() at
all - just call the function instead.
If the call is in board-neutral MIPS code then things get more complicated.
Sure, the code is safe on UP, but it might be deadlocky on SMP. It needs
to be thought about and a suitable UP&&SMP fix needs to be found.
Can someone point me at the code we're talking about here? file-n-line?
|