netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: Denys Fedoryshchenko <denys@visp.net.lb>, netdev@vger.kernel.org
Subject: Re: circular locking, mirred, 2.6.24.2
Date: Fri, 07 Mar 2008 08:53:22 -0500	[thread overview]
Message-ID: <1204898002.4431.99.camel@localhost> (raw)
In-Reply-To: <20080307075113.GA3912@ff.dom.local>

On Fri, 2008-07-03 at 07:51 +0000, Jarek Poplawski wrote:

> 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, 

The problem is not so much so that it is an impossible situation, rather
it is not a useful detail to report as is. 
As an example, heres something i consider useful to catch:
 dev->queuelock for ethx being held recursively
In your current setup, there will be many false-positives. i.e it will
show something like dev->queuelock for eth0 is being held and flagging
that as a problem because dev->queuelock for eth1 is also being held.
i.e a lot of noise.

> 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.

It is possible some odd issue will be found by having the lockdeps in
their current setup - but if you have to sift through noise in order to
find it, then it makes it harder.

> 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. 

Is it time to do that now? I know you said it was too much data to
carry. However, such data depends on how many netdevices are on the
system and lockdep is optional. You could even make NETDEV_LOCKDEP
version which is accurate and the other one as being less accurate.

> 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).

I am curious what issue has been found with this approach. I can see
that someone who knows what they are doing could sift through reports
and be able to catch something. My thinking is it most reports are going
to be noise. People will report them because they are scary looking.

> Such specific information is usually necessary only with nesting.

It could also apply to a single lock (for example redirecting 
eth0->eth0 or eth0->manyotherredirectshere->eth0)

> 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.

ifb never ever works with ingress. It is design intent. It is a special
netdevice (as the text says) which receives only redirected packets.

> I've to find first what really bothers lockdep here, and why this
> queue_lock vs. ingress_lock order isn't reported "by default". 

I dont see the problem in this case, those traces are false-positives -
but no harm in investigating further. I still think the only time you
can find real issues is when you have per-netdevice lockdep; anything
else will only find issues only with the help of an expert.

> 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.

true. 

> (Maybe even sooner if lockdep finds something real after this current
> patch to ifb.)

As it stands right now Jarek, I think you need to teach lockedep more
smarter details.

cheers,
jamal


  parent reply	other threads:[~2008-03-07 13:53 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
2008-03-07  8:32                       ` Jarek Poplawski
2008-03-07 13:53                       ` jamal [this message]
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=1204898002.4431.99.camel@localhost \
    --to=hadi@cyberus.ca \
    --cc=denys@visp.net.lb \
    --cc=jarkao2@gmail.com \
    --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).