netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Ian McDonald <ian.mcdonald@jandi.co.nz>
Cc: Arjan van de Ven <arjan@linux.intel.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
	DCCP Mailing List <dccp@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>
Subject: Re: Locking validator output on DCCP
Date: Fri, 23 Jun 2006 09:45:49 +0200	[thread overview]
Message-ID: <20060623074549.GA30155@elte.hu> (raw)
In-Reply-To: <5640c7e00606221938g17516d08yf6733fc35f866d01@mail.gmail.com>


* Ian McDonald <ian.mcdonald@jandi.co.nz> wrote:

> OK. This is in net/ipv4/tcp_ipv4.c tcp_v4_rcv with the 
> bh_lock_sock_nested which I presume is clashing with the nested of 
> skb_clone....

yeah, that's exactly what happens.

> Can we not do two levels nested?

we can - but it needs to be thought through (and needs to be tested). 
But an initial glance seems to suggest that two levels, one used for 
clone and another one used for tcp_v4_rcv nesting ought to do the trick.

> Is there extra documentation for the locking validation suite so that 
> I can stop asking stupid questions? If not I'll just read more of the 
> source code.

i'd suggest to start with: Documentation/lockdep-design.txt, then with 
include/linux/lockdep.h and also look at some of the existing patches 
that introduce multiple nesting levels, such as:

    http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17/2.6.17-mm1/broken-out/lock-validator-special-locking-dcache.patch

the best method is to find the proper central header for the level enum, 
and then make use of it. The enum should have a descriptive name, and 
the enum values too.

If one particular lock has multiple levels then SINGLE_DEPTH_NESTING 
should not be used. (to keep the levels architecture clean) I.e. 
possibly the best idea would be to extend bh_lock_sock_nested() with a 
'subtype' parameter, and to pass that into spin_lock_nested().

Or even better: define bh_lock_sock_nested() as an inline function with 
the right enum parameter, which will make sure only the right type of 
enum will be used. [if it's possible to do it as an inline there - it's 
a macro right now and i'm not sure all the types necessary for the 
inline are declared up to that point in the sock.h include file]

	Ingo

  reply	other threads:[~2006-06-23  7:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-20 23:40 Locking validator output on DCCP Ian McDonald
2006-06-21  0:34 ` Herbert Xu
2006-06-21 10:18   ` Arjan van de Ven
2006-06-22  4:51     ` Ian McDonald
2006-06-23  2:38       ` Ian McDonald
2006-06-23  7:45         ` Ingo Molnar [this message]
2006-06-21 10:52   ` Ingo Molnar
2006-06-22  4:55     ` Ian McDonald

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=20060623074549.GA30155@elte.hu \
    --to=mingo@elte.hu \
    --cc=arjan@linux.intel.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=dccp@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=ian.mcdonald@jandi.co.nz \
    --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).