public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Subject: socket locking obscure code
Date: Sat, 1 Sep 2007 08:50:20 +0400	[thread overview]
Message-ID: <20070901045020.GA7221@cvg> (raw)

Hi LKML,
 
looking thru lock_sock_nested (while trying to catch
BUG in CIFS as reported on bugzilla #8377) I found
that lock_sock_nested consist of:

void fastcall lock_sock_nested(struct sock *sk, int subclass)
{
	might_sleep();
--->	spin_lock_bh(&sk->sk_lock.slock);
	if (sk->sk_lock.owner)
		__lock_sock(sk);
	sk->sk_lock.owner = (void *)1;
--->	spin_unlock(&sk->sk_lock.slock);
	/*
	 * The sk_lock has mutex_lock() semantics here:
	 */
	mutex_acquire(&sk->sk_lock.dep_map, subclass, 0, _RET_IP_);
	local_bh_enable();
}
 
so why spin_unlock are there instead of spin_unlock_bh?
To recope with __lock_sock? Am I right?
 
 		Cyrill
 

                 reply	other threads:[~2007-09-01  4:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070901045020.GA7221@cvg \
    --to=gorcunov@gmail.com \
    --cc=linux-kernel@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