[openib-general] [PATCH] Convert idr's internal locking to _irqsave variant
Ingo Molnar
mingo at elte.hu
Wed Jul 12 14:14:43 PDT 2006
* Roland Dreier <rdreier at cisco.com> wrote:
> Currently, the code in lib/idr.c uses a bare spin_lock(&idp->lock) to
> do internal locking. This is a nasty trap for code that might call
> idr functions from different contexts; for example, it seems perfectly
> reasonable to call idr_get_new() from process context and idr_remove()
> from interrupt context -- but with the current locking this would lead
> to a potential deadlock.
>
> The simplest fix for this is to just convert the idr locking to use
> spin_lock_irqsave().
>
> In particular, this fixes a very complicated locking issue detected by
> lockdep, involving the ib_ipoib driver's priv->lock and
> dev->_xmit_lock, which get involved with the ib_sa module's
> query_idr.lock.
>
> Cc: Arjan van de Ven <arjan at infradead.org>
> Cc: Ingo Molnar <mingo at elte.hu>
Acked-by: Ingo Molnar <mingo at elte.hu>
Ingo
More information about the general
mailing list