Re: [PATCH 1/10] Add generic helpers for arch IPI function calls

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Catalin Marinas <catalin.marinas@...>
Cc: Jens Axboe <jens.axboe@...>, <linux-kernel@...>, <peterz@...>, <npiggin@...>, <linux-arch@...>, <jeremy@...>, <mingo@...>, <paulmck@...>, Russell King <rmk+lkml@...>
Date: Tuesday, June 10, 2008 - 11:44 am

On Tue, 2008-06-10 at 15:51 +0100, Catalin Marinas wrote:

I don't see how your proposal fixes the deadlocks.  The problem is that
on a lot of arch's IPIs are normal interrupts.  If interrupts are
disabled, you don't see them.

The deadlock scenario is CPU1 enters smp_call_function() with IRQ's
disabled as CPU2 does the same thing and spins on the call_lock.  Now
CPU1 is waiting for an ack for its IPI to CPU2, but CPU2 will never see
the IPI until it enables interrupts.

One way to mitigate the effects of this is to enable interrupts if the
architecture code finds the call_lock (x86 implementation) held against
it, then re-disable before trying to get the lock again.  But really, in
order to make smp_call_function work in interrupt disabled sections, the
interrupt handler has to be modified to bar all non-IPI interrupts until
the critical section is over (otherwise there's no point allowing it
with disabled interrupts because an smp_call_function becomes a de facto
interrupt enable again).  If you really want to see how something like
this works, the voyager code has it (because interrupt disabling in the
VIC is expensive).  But it's quite a lot of code ...

James


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 0/10] Add generic helpers for arch IPI function c..., Jeremy Fitzhardinge, (Sun Jun 1, 5:52 am)
Re: [PATCH 2/10] x86: convert to generic helpers for IPI fun..., Jeremy Fitzhardinge, (Thu May 29, 8:12 am)
Re: [PATCH 2/10] x86: convert to generic helpers for IPI fun..., Jeremy Fitzhardinge, (Thu May 29, 9:47 am)
Re: [PATCH 1/10] Add generic helpers for arch IPI function c..., Jeremy Fitzhardinge, (Sun Jul 6, 1:21 pm)
Re: [PATCH 1/10] Add generic helpers for arch IPI function c..., Paul E. McKenney, (Tue Jun 10, 11:47 am)
Re: [PATCH 1/10] Add generic helpers for arch IPI function c..., James Bottomley, (Tue Jun 10, 11:44 am)