[patch] lockdep, annotate slocks: turn lockdep off for them

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

	Ingo

----------------
Subject: lockdep, annotate slocks: turn lockdep off for them
From: Ingo Molnar <[email protected]>

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 <[email protected]>
---
 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux