linux-mips
[Top] [All Lists]

Re: Commit 78eef01b0fae087c5fadbd85dd4fe2918c3a015f (on_each_cpu(): disa

To: Kumba <kumba@gentoo.org>
Subject: Re: Commit 78eef01b0fae087c5fadbd85dd4fe2918c3a015f (on_each_cpu(): disable local interrupts) Breaks SGI IP32
From: Andrew Morton <akpm@osdl.org>
Date: Sat, 27 May 2006 21:31:50 -0700
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org
In-reply-to: <4479250E.3080604@gentoo.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <4478C0F1.8000006@gentoo.org> <20060528010603.GA24997@linux-mips.org> <20060527194243.a8157338.akpm@osdl.org> <4479250E.3080604@gentoo.org>
Sender: linux-mips-bounce@linux-mips.org
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?


<Prev in Thread] Current Thread [Next in Thread>