From: Jarek Poplawski <jarkao2@gmail.com>
To: jamal <hadi@cyberus.ca>
Cc: Denys Fedoryshchenko <denys@visp.net.lb>, netdev@vger.kernel.org
Subject: Re: circular locking, mirred, 2.6.24.2
Date: Fri, 7 Mar 2008 07:51:13 +0000 [thread overview]
Message-ID: <20080307075113.GA3912@ff.dom.local> (raw)
In-Reply-To: <1204846839.4431.23.camel@localhost>
On Thu, Mar 06, 2008 at 06:40:39PM -0500, jamal wrote:
> Jarek,
>
> On Thu, 2008-06-03 at 22:40 +0100, Jarek Poplawski wrote:
>
> > But currently lockdep doesn't know dev->queue_lock could mean eth or lo.
> > It sees one class of devices using one lock.
>
> yikes ;-> I missed the implication when you mentioned it first - thanks
> for the enlightnment. IMO, it needs to be per netdevice not global; so i
> contend this is the problem i.e those warnings are false.
>
> > We can let it know (e.g.
> > dev->_xmit_lock is different according to dev->type), but it wasn't
> > necessary. I hope it will suffice here if lockdep knows more about ifb,
> > but similar problem could theoretically happen with other devs.
>
> I think the condition needs to be met for all netdevices, not just ifb.
> Instead of annotating each netdevice type separately, could you not use
> a different annotation in the generic netdev registration code of the
> form dev_%s->ingress/queue_lock ? (where %s is dev->name)
At first this lockdep method looks like wrong (too general). But it
works. With every lock tracked separately there would be huge overhead
(especially with some structures created in thousands of instances).
And with this general approach we can see general problems: e.g.
wrong locking order even reported on two different devices like here,
and impossible in reality, can help to analyze if the same could
happen in another, maybe even very hard to reproduce, variant, and to
fix this before ever happened.
So, current way is to start from very general tracking, and if it
doesn't work (I mean false reports, not lockups), we make it more
specific. With dev->_xmit_lock the type level seems to be enough
for some time (so lockdep doesn't even know eth0 and eth1 created
as ARPHRD_ETHER use 2 different _xmit_locks).
Such specific information is usually necessary only with nesting.
But here, with sch_ingress + act_mirred it's not about nesting: it's
really about wrong order, which could be safe only because ifb
doesn't currently work with a full egress + ingress functionality.
Making this all more specific for lockdep won't help with real
lockups then, but will make reports more exact and less reproducible.
> > Sorry, should be:
> > dev_eth0->queue_lock, and thread3 has dev_eth0->queue_lock and wants
>
> indeed - i understood when you said that; it doesnt invalidate what i
> said.
>
> > > thread3 can not happen because we dont allow it (the other 2 are not
> > > contentious).
> >
> > Could you explain why?
>
> Because we never redirect to ingress (it is in the todo as mentioned as
> described at the top of the source file). You can redirect from ingress
> or egress but only to egress (to sockets and ingress are going to happen
> at some future point).
>
> > Yes, but it seems such redirection between two eths like above mentioned
> > is legal?
>
> Indeed it is. I think it is clear to me now the issues seem to be the
> namespace of what lockdep - it should be per-device and NOT global.
> What do you think?
I've to find first what really bothers lockdep here, and why this
queue_lock vs. ingress_lock order isn't reported "by default". But if
this really is like it looks now, then it seems before doing this
ingress "future point" some change in locking could be necessary.
(Maybe even sooner if lockdep finds something real after this current
patch to ifb.)
Cheers,
Jarek P.
next prev parent reply other threads:[~2008-03-07 7:49 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-24 22:20 circular locking, mirred, 2.6.24.2 Denys Fedoryshchenko
2008-02-25 9:56 ` Jarek Poplawski
2008-02-25 10:48 ` Denys Fedoryshchenko
2008-02-25 11:39 ` Jarek Poplawski
2008-03-05 10:45 ` Denys Fedoryshchenko
2008-03-05 13:54 ` [BUG] Probably lockdep bug " Jarek Poplawski
2008-03-06 9:41 ` Jarek Poplawski
2008-03-06 13:40 ` Jarek Poplawski
2008-03-06 13:57 ` Denys Fedoryshchenko
2008-03-06 14:27 ` jamal
2008-03-06 15:50 ` Denys Fedoryshchenko
2008-03-06 20:25 ` Jarek Poplawski
2008-03-06 20:56 ` jamal
2008-03-06 22:12 ` Jarek Poplawski
2008-03-06 23:43 ` Denys Fedoryshchenko
2008-03-07 0:09 ` jamal
2008-03-07 0:15 ` Denys Fedoryshchenko
2008-03-07 0:25 ` jamal
2008-03-07 9:31 ` Jarek Poplawski
2008-03-07 10:19 ` Denys Fedoryshchenko
2008-03-07 10:48 ` Jarek Poplawski
2008-03-07 14:58 ` jamal
2008-03-06 20:44 ` jamal
2008-03-06 13:59 ` jamal
2008-03-06 17:56 ` Jarek Poplawski
2008-03-06 20:48 ` jamal
2008-03-06 21:40 ` Jarek Poplawski
2008-03-06 23:40 ` jamal
2008-03-07 7:51 ` Jarek Poplawski [this message]
2008-03-07 8:32 ` Jarek Poplawski
2008-03-07 13:53 ` jamal
2008-03-08 8:46 ` Jarek Poplawski
2008-03-08 8:58 ` Jarek Poplawski
2008-03-08 9:56 ` Denys Fedoryshchenko
2008-03-08 10:16 ` Denys Fedoryshchenko
2008-03-08 10:43 ` Jarek Poplawski
2008-03-08 10:52 ` Jarek Poplawski
2008-03-08 11:09 ` Denys Fedoryshchenko
2008-03-08 12:02 ` Jarek Poplawski
2008-03-19 0:46 ` Denys Fedoryshchenko
2008-03-19 7:34 ` [PATCH][NET] ifb: set separate lockdep classes for queue locks Jarek Poplawski
2008-03-19 11:34 ` jamal
2008-03-19 12:20 ` Jarek Poplawski
2008-03-20 22:37 ` David Miller
2008-03-21 0:03 ` [PATCH take2][NET] " Jarek Poplawski
2008-03-21 0:05 ` David Miller
2008-03-21 0:15 ` 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=20080307075113.GA3912@ff.dom.local \
--to=jarkao2@gmail.com \
--cc=denys@visp.net.lb \
--cc=hadi@cyberus.ca \
--cc=netdev@vger.kernel.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).