All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Paasch <christoph.paasch@uclouvain.be>
To: netdev@vger.kernel.org
Subject: tcp_close - why no WARN_ON ?
Date: Mon, 19 Dec 2011 13:57:35 +0100	[thread overview]
Message-ID: <4EEF34BF.7050302@uclouvain.be> (raw)

Hi all,

I am trying to understand the following code in tcp_close:

  sock_orphan(sk);

  /* It is the last release_sock in its life. It will remove backlog. */
  release_sock(sk);

  /* Now socket is owned by kernel and we acquire BH lock
     to finish close. No need to check for user refs.
   */
  local_bh_disable();
  bh_lock_sock(sk);
  WARN_ON(sock_owned_by_user(sk));


How is it possible that between release_sock(sk) and local_bh_disable(),
no other thread gets scheduled and calls lock_sock() and thus the
WARN_ON would be triggered ?


Can someone please point me to the lines of code that handle this ?


Thanks a lot,
Christoph



-- 
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://mptcp.info.ucl.ac.be
Université Catholique de Louvain
-- 

                 reply	other threads:[~2011-12-19 12:57 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=4EEF34BF.7050302@uclouvain.be \
    --to=christoph.paasch@uclouvain.be \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.