public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Miles Lane <miles.lane@gmail.com>
Cc: Andrew Morton <akpm@osdl.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Arjan van de Ven <arjan@infradead.org>
Subject: [patch] lockdep, annotate slocks: turn lockdep off for them
Date: Fri, 30 Jun 2006 09:22:31 +0200	[thread overview]
Message-ID: <20060630072231.GB7057@elte.hu> (raw)
In-Reply-To: <20060630065041.GB6572@elte.hu>


Miles, does the patch below make the message go away?

	Ingo

----------------
Subject: lockdep, annotate slocks: turn lockdep off for them
From: Ingo Molnar <mingo@elte.hu>

temporary solution to turn off slock related false positives:
the slock is pretty much the only lock type in the kernel that
is half spinlock, half waitqueue. "Process level" and "softirq level"
uses of slock are excluded - albeit the spinlock itself is not
permanently held in process context.

The right solution will be to annotate slock uses with
acquire()/release(). (i.e. to treat sock_owned_by_user() flagged
areas as an exclusion area too)

(this temporary solution is not as bad as it might sound, because it 
does not eliminate the various ->sk_backlog_rcv() related dependencies 
from the validator's dependency graph - what it does is that it doesnt 
record them relative to slock. [the callbacks will still be executed and 
covered when the backlog is processed.])

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 net/core/sock.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Index: linux/net/core/sock.c
===================================================================
--- linux.orig/net/core/sock.c
+++ linux/net/core/sock.c
@@ -250,9 +250,17 @@ int sk_receive_skb(struct sock *sk, stru
 	skb->dev = NULL;
 
 	bh_lock_sock(sk);
-	if (!sock_owned_by_user(sk))
+	if (!sock_owned_by_user(sk)) {
+		/*
+		 * FIXME: teach the validator about slocks.
+		 *
+		 * For now we dont record dependencies in
+		 * this codepath.
+		 */
+		lockdep_off();
 		rc = sk->sk_backlog_rcv(sk, skb);
-	else
+		lockdep_on();
+	} else
 		sk_add_backlog(sk, skb);
 	bh_unlock_sock(sk);
 out:

  parent reply	other threads:[~2006-06-30  7:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-29 19:01 2.6.17-mm3 -- BUG: illegal lock usage -- illegal {softirq-on-W} -> {in-softirq-R} usage Miles Lane
2006-06-29 19:26 ` Andrew Morton
2006-06-29 19:42   ` Arjan van de Ven
2006-06-29 19:56     ` Andrew Morton
2006-06-30  2:57       ` Herbert Xu
2006-06-30  6:50 ` Ingo Molnar
2006-06-30  6:59   ` Ingo Molnar
2006-06-30  7:22   ` Ingo Molnar [this message]
2006-06-30  9:18     ` [patch] lockdep, annotate slocks: turn lockdep off for them Ingo Molnar
2006-06-30 11:17       ` Herbert Xu
2006-06-30 11:37         ` Ingo Molnar
2006-06-30 11:46           ` Herbert Xu
2006-06-30 20:21           ` Miles Lane
2006-06-30 20:38             ` Ingo Molnar
2006-06-30 22:45               ` Miles Lane
2006-07-01  0:14                 ` Miles Lane
2006-07-01  5:32                 ` Ingo Molnar
2006-07-01  9:41                 ` Arjan van de Ven
2006-07-01 14:06                   ` Miles Lane
2006-07-01 14:07                     ` Herbert Xu
2006-07-01 14:10                       ` Miles Lane
2006-07-01 14:19                         ` Miles Lane

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=20060630072231.GB7057@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miles.lane@gmail.com \
    /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