netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] team: set qdisc_tx_busylock to avoid LOCKDEP splat
@ 2012-10-04  9:18 Eric Dumazet
  2012-10-04  9:22 ` Jiri Pirko
  2012-10-04 19:54 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2012-10-04  9:18 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Jiri Pirko

From: Eric Dumazet <edumazet@google.com>

If a qdisc is installed on a team device, its possible to get
a lockdep splat under stress, because nested dev_queue_xmit() can
lock busylock a second time (on a different device, so its a false
positive)

Avoid this problem using a distinct lock_class_key for team
devices.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jiri Pirko <jpirko@redhat.com>
---
 drivers/net/team/team.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 5c7547c..d44cca3 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1315,6 +1315,7 @@ static const struct team_option team_options[] = {
 
 static struct lock_class_key team_netdev_xmit_lock_key;
 static struct lock_class_key team_netdev_addr_lock_key;
+static struct lock_class_key team_tx_busylock_key;
 
 static void team_set_lockdep_class_one(struct net_device *dev,
 				       struct netdev_queue *txq,
@@ -1327,6 +1328,7 @@ static void team_set_lockdep_class(struct net_device *dev)
 {
 	lockdep_set_class(&dev->addr_list_lock, &team_netdev_addr_lock_key);
 	netdev_for_each_tx_queue(dev, team_set_lockdep_class_one, NULL);
+	dev->qdisc_tx_busylock = &team_tx_busylock_key;
 }
 
 static int team_init(struct net_device *dev)

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

* Re: [PATCH] team: set qdisc_tx_busylock to avoid LOCKDEP splat
  2012-10-04  9:18 [PATCH] team: set qdisc_tx_busylock to avoid LOCKDEP splat Eric Dumazet
@ 2012-10-04  9:22 ` Jiri Pirko
  2012-10-04 19:54 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2012-10-04  9:22 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev, Jiri Pirko

Thu, Oct 04, 2012 at 11:18:39AM CEST, eric.dumazet@gmail.com wrote:
>From: Eric Dumazet <edumazet@google.com>
>
>If a qdisc is installed on a team device, its possible to get
>a lockdep splat under stress, because nested dev_queue_xmit() can
>lock busylock a second time (on a different device, so its a false
>positive)
>
>Avoid this problem using a distinct lock_class_key for team
>devices.
>
>Signed-off-by: Eric Dumazet <edumazet@google.com>
>Cc: Jiri Pirko <jpirko@redhat.com>
>---
> drivers/net/team/team.c |    2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>index 5c7547c..d44cca3 100644
>--- a/drivers/net/team/team.c
>+++ b/drivers/net/team/team.c
>@@ -1315,6 +1315,7 @@ static const struct team_option team_options[] = {
> 
> static struct lock_class_key team_netdev_xmit_lock_key;
> static struct lock_class_key team_netdev_addr_lock_key;
>+static struct lock_class_key team_tx_busylock_key;
> 
> static void team_set_lockdep_class_one(struct net_device *dev,
> 				       struct netdev_queue *txq,
>@@ -1327,6 +1328,7 @@ static void team_set_lockdep_class(struct net_device *dev)
> {
> 	lockdep_set_class(&dev->addr_list_lock, &team_netdev_addr_lock_key);
> 	netdev_for_each_tx_queue(dev, team_set_lockdep_class_one, NULL);
>+	dev->qdisc_tx_busylock = &team_tx_busylock_key;
> }
> 
> static int team_init(struct net_device *dev)
>
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

Thanks Eric.

Acked-by: Jiri Pirko <jiri@resnulli.us>

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

* Re: [PATCH] team: set qdisc_tx_busylock to avoid LOCKDEP splat
  2012-10-04  9:18 [PATCH] team: set qdisc_tx_busylock to avoid LOCKDEP splat Eric Dumazet
  2012-10-04  9:22 ` Jiri Pirko
@ 2012-10-04 19:54 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2012-10-04 19:54 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, jpirko

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 04 Oct 2012 11:18:39 +0200

> From: Eric Dumazet <edumazet@google.com>
> 
> If a qdisc is installed on a team device, its possible to get
> a lockdep splat under stress, because nested dev_queue_xmit() can
> lock busylock a second time (on a different device, so its a false
> positive)
> 
> Avoid this problem using a distinct lock_class_key for team
> devices.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Jiri Pirko <jpirko@redhat.com>

Applied.

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

end of thread, other threads:[~2012-10-04 19:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-04  9:18 [PATCH] team: set qdisc_tx_busylock to avoid LOCKDEP splat Eric Dumazet
2012-10-04  9:22 ` Jiri Pirko
2012-10-04 19:54 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).