lkml.org 
[lkml]   [2006]   [Jun]   [30]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateFri, 30 Jun 2006 09:22:31 +0200
FromIngo Molnar <>
Subject[patch] lockdep, annotate slocks: turn lockdep off for them
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:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-06-30 09:29    [from the cache]
©2003-2008