Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- From: Ingo Molnar <mingo@xxxxxxx>
- Date: Thu, 8 Jun 2006 12:53:43 +0200
* David Woodhouse <dwmw2@xxxxxxxxxxxxx> wrote:
On Thu, 2006-06-08 at 10:31 +1000, Benjamin Herrenschmidt wrote:
I still don't think where is the suckage in just not hard-enabling in
the mutex debug code...
If the mutex debugging code is hard-enabling interrupts before
init_IRQ() ever got called, that's just broken. Fixing that can hardly
be called 'suckage'.
to quote Andrew:
--------------->
Nonsense. mutex_lock() can sleep. Sleeping will enable interrupts.
Therefore, hence, ergo ipso facto mutex_lock() can enable interrupts. QED,
that's it.
But now, because some broken piece of hardware is coming out of
reset/firmware asserting an interrupt we need to change the rules to be
"mutex_lock() must preserve local interrupts if the lock is uncontended".
Ditto down(), down_read() and down_write().
And why does this bizarre restriction upon the implementation of our
locking primtives exist? Because of your broken PIC and because of our
inability to sort out the early boot code. And because the early boot code
has this implicit knowledge that the locks will be uncontended, else we're
toast.
We're doing mutex_lock(), down(), down_read() and down_write() with local
interrupts disabled, which is a bug. We have explicit code in there to
*disable* our runtime debugging checks because we know about this bug but
don't know how to fix it.
I call that sucky.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- From: David Woodhouse
- Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- References:
- 2.6.18 -mm merge plans
- From: Andrew Morton
- mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- From: Benjamin Herrenschmidt
- Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- From: Andrew Morton
- Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- From: Benjamin Herrenschmidt
- Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- From: Andrew Morton
- Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- From: Benjamin Herrenschmidt
- Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- From: Ingo Molnar
- Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- From: Benjamin Herrenschmidt
- Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- From: David Woodhouse
- 2.6.18 -mm merge plans
- Prev by Date: Re: IRQ sharing: BUG: spinlock lockup on CPU#0
- Next by Date: Re: 2.6.17-rc6-mm1 -- BUG: possible circular locking deadlock detected!
- Previous by thread: Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- Next by thread: Re: mutex vs. local irqs (Was: 2.6.18 -mm merge plans)
- Index(es):
Relevant Pages
|