From: Jarek Poplawski <jarkao2@o2.pl>
To: "Yuriy N\. Shkandybin" <jura@netams.com>
Cc: akpm@linux-foundation.org, netdev@vger.kernel.org,
jura@netams.com, paulus@samba.org, greearb@candelatech.com,
mostrows@speakeasy.net, davem@davemloft.net
Subject: [PATCH] vlan: lockdep subclass for ppp _xmit_lock Re: ppp_generic: fix lockdep warning
Date: Wed, 9 May 2007 11:35:37 +0200 [thread overview]
Message-ID: <20070509093536.GA2436@ff.dom.local> (raw)
In-Reply-To: <20070426104950.GA3145@ff.dom.local>
On Thu, Apr 26, 2007 at 12:49:50PM +0200, Jarek Poplawski wrote:
...
> But there is also a second, very similar lockdep report,
> probably also false (lockdep cannot see the difference
> between locks of two different, I hope, vlan devices),
> which needs more work:
> a) vlan should use different lockdep lock subclasses or
> classes for each device, which would require quite a lot
> of static memory reserved, probably only to silence
> lockdep,
> b) pppoe could change the way of sending packets, so
> the locks of ppp_generic were not seen by lockdep
> with so many variants; I'm not sure the maintainer of
> pppoe likes this idea;
>
> Doing a) should be enough, I guess; doing b) is easier
> but, probably, the similar is possible elsewhere, too.
...
> Currently I think about some change in lockdep, to track
> something like different vlans with less memory, but I'm
> not sure it'll work, yet.
After rethinking there is the 3-rd way (as usual):
c) vlan should use different lockdep lock subclasses or
classes for different types of devices, used at the same
time.
This patch is intended for testing, so should be applied
after some confirmation. (It should be safe anyway.)
If this works, the previous lockdep patch on ppp_generic
should be really superfluous.
Yuriy, could you try this patch, please?
This is done on 2.6.21, but could be applied to current -mm
or -git, too. If you prefere some other version, let me know.
Regards,
Jarek P.
--->
This patch's aim is to let lockdep see ppp devs as different
from others (default), and it's OK to take: _xmit_lock of vlan
and _xmit_lock of ppp with reverse order provided vlan _xmit_locks
are bound to different devs (ppp and e.g. eth).
> =======================================================
> [ INFO: possible circular locking dependency detected ]
> 2.6.21-rc6-mm1 #4
> -------------------------------------------------------
> pppd/14305 is trying to acquire lock:
> (&vlan_netdev_xmit_lock_key){-...}, at: [<ffffffff8022f90b>]
> dev_queue_xmit+0x26b/0x300
>
> but task is already holding lock:
> (&pch->downl#2){-+..}, at: [<ffffffff80388d3c>] ppp_push+0x5f/0xa7
>
> which lock already depends on the new lock.
Reported & tested by: "Yuriy N. Shkandybin" <jura@netams.com>
Cc: Ben Greear <greearb@candelatech.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michal Ostrowski <mostrows@speakeasy.net>
Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>
---
diff -Nurp 2.6.21-/net/8021q/vlan.c 2.6.21/net/8021q/vlan.c
--- 2.6.21-/net/8021q/vlan.c 2007-05-01 12:43:39.000000000 +0200
+++ 2.6.21/net/8021q/vlan.c 2007-05-07 21:09:30.000000000 +0200
@@ -535,7 +535,13 @@ static struct net_device *register_vlan_
if (register_netdevice(new_dev))
goto out_free_newdev;
- lockdep_set_class(&new_dev->_xmit_lock, &vlan_netdev_xmit_lock_key);
+ if (unlikely(real_dev->type == ARPHRD_PPP))
+ /* pppoe uses two different kinds of _xmit_lock for ppp & eth */
+ lockdep_set_class_and_subclass(&new_dev->_xmit_lock,
+ &vlan_netdev_xmit_lock_key, 1);
+ else
+ lockdep_set_class(&new_dev->_xmit_lock,
+ &vlan_netdev_xmit_lock_key);
new_dev->iflink = real_dev->ifindex;
vlan_transfer_operstate(real_dev, new_dev);
next prev parent reply other threads:[~2007-05-09 9:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-26 7:27 [patch 10/15] ppp_generic: fix lockdep warning akpm
2007-04-26 8:39 ` David Miller
2007-04-26 10:49 ` Jarek Poplawski
2007-05-09 9:35 ` Jarek Poplawski [this message]
2007-05-09 9:32 ` [PATCH] vlan: lockdep subclass for ppp _xmit_lock " David Miller
2007-05-09 13:13 ` [PATCH (take 2)] vlan: lockdep class " Jarek Poplawski
2007-05-09 20:06 ` [PATCH] vlan: lockdep subclass " Yuriy N. Shkandybin
2007-05-10 5:30 ` Jarek Poplawski
2007-05-10 6:03 ` Yuriy N. Shkandybin
2007-05-10 6:39 ` Jarek Poplawski
2007-05-11 7:00 ` [PATCH] ppp_generic: lockdep class " Jarek Poplawski
2007-04-26 10:04 ` [patch 10/15] " Paul Mackerras
2007-04-26 11:28 ` Jarek Poplawski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070509093536.GA2436@ff.dom.local \
--to=jarkao2@o2.pl \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=greearb@candelatech.com \
--cc=jura@netams.com \
--cc=mostrows@speakeasy.net \
--cc=netdev@vger.kernel.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).