public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* ipoib lockdep warning
@ 2006-07-11 20:10 Zach Brown
  2006-07-11 21:16 ` Michael S. Tsirkin
                   ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Zach Brown @ 2006-07-11 20:10 UTC (permalink / raw)
  To: openib-general, Linux Kernel Mailing List, Arjan van de Ven,
	Ingo Molnar

I get an awfully verbose lockdep warning when I bring up ipoib devices
and wanted to make sure it didn't go unreported.  I've put it up at the
following URL:

  http://oss.oracle.com/~zab/ipoib-multicast-lockdep-warning.txt

I looked into it a bit and it seems to be on to something.  There might
be a AB, BC, CA ordering deadlock.

AB:

priv->lock is held while acquiring query_idr.lock

ipoib_mcast_send()
  spin_lock(&priv->lock);
  ipoib_mcast_sendonly_join()
    ib_sa_mcmember_rec_query()
      send_mad()
        idr_pre_get(&query_idr)
          spin_lock(&idp->lock);

BC:

query_idr.lock is taken with interrupts enabled and so is implicitly
ordered before dev->_xmit_lock which is taken in interrupt context.

ipoib_mcast_join_task()
  ipoib_mcast_join()
    ib_sa_mcmember_rec_query()
      send_mad()
        idr_pre_get(&query_idr)
          spin_lock(&idp->lock)

CA:

dev->_xmit_lock is held while acquiring priv->lock.  This triggers the
lockdep warning that adding the dep between dev->_xmit_lock and
priv->lock connects a soft-irq-safe lock to a soft-irq-unsafe one.

ipoib_mcast_restart_task()
  local_irq_save(flags);
  netif_tx_lock(dev)
    spin_lock(&dev->_xmit_lock);
  spin_lock(&priv->lock);

I can imagine all sorts of potential fixes (block ints when calling idr?
 reorder acquiry in ipoib_mcast_restart_task()?) but I'm operating on a
partial view of the paths here so I wasn't comfortable suggesting a fix.
 I wouldn't be surprised to hear that there are circumstances that both
lockdep and I don't know about that stop this from being a problem :).

In any case, it'd be fantastic if someone who knows this code could sit
down with lockdep and some ipoib regression suite to shake out lockdep's
complaints.

- z

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2006-07-17 15:57 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-11 20:10 ipoib lockdep warning Zach Brown
2006-07-11 21:16 ` Michael S. Tsirkin
2006-07-11 21:40   ` Sean Hefty
2006-07-11 21:50     ` [openib-general] " Zach Brown
2006-07-11 22:54 ` Roland Dreier
2006-07-11 23:27   ` Zach Brown
2006-07-11 23:43     ` Roland Dreier
2006-07-11 23:53       ` Zach Brown
2006-07-12  0:06         ` Roland Dreier
2006-07-12  9:38       ` Ingo Molnar
2006-07-12 11:09         ` Michael S. Tsirkin
2006-07-12 16:31           ` [openib-general] " Sean Hefty
2006-07-12 18:56           ` Roland Dreier
2006-07-13 15:55           ` [PATCH] IB/core: use correct gfp_mask in sa_query Michael S. Tsirkin
2006-07-12 19:06         ` [openib-general] ipoib lockdep warning Roland Dreier
2006-07-12 20:45         ` [PATCH] Convert idr's internal locking to _irqsave variant Roland Dreier
2006-07-12 21:14           ` Ingo Molnar
2006-07-13  1:30           ` Andrew Morton
2006-07-13 15:42             ` Roland Dreier
2006-07-13 20:54               ` Andrew Morton
2006-07-13 21:03                 ` Roland Dreier
2006-07-13 21:05                   ` Arjan van de Ven
2006-07-14  0:18                     ` Roland Dreier
2006-07-14  6:20                       ` Arjan van de Ven
2006-07-13 21:43                   ` Andrew Morton
2006-07-14  1:08                     ` Roland Dreier
2006-07-14  1:18                       ` Andrew Morton
2006-07-14  1:30                         ` Andrew Morton
2006-07-17 15:57                           ` Roland Dreier
2006-07-12  2:33 ` [openib-general] ipoib lockdep warning Roland Dreier
2006-07-12  6:49   ` Arjan van de Ven
2006-07-12 19:01     ` Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox