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

From: Herbert Xu
Date: Fri Jun 30 2006 - 07:21:57 EST


On Fri, Jun 30, 2006 at 11:18:50AM +0200, Ingo Molnar wrote:
>
> Herbert, do the acquire/release semantics as expressed in the
> lockdep-annotate-slock.patch match sk_lock semantics?

I think it should be fine.

> @@ -250,9 +283,18 @@ 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)) {
> + /*
> + * trylock + unlock semantics:
> + */
> + spin_release(&sk->sk_lock.slock.dep_map, 1, _RET_IP_);
> + mutex_acquire(&sk->sk_lock.dep_map, 0, 1, _RET_IP_);

Although it would seem that keeping the spin lock would fit the actual
semantics better. I suppose there must be a technical reason why this
wouldn't work.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/