From: ratheesh kannoth <ratheesh.ksz@gmail.com>
To: netdev <netdev@vger.kernel.org>,
linux-newbie <linux-newbie@vger.kernel.org>
Subject: sock_hold and sock_put
Date: Wed, 24 Jun 2015 14:47:35 +0530 [thread overview]
Message-ID: <CAGZFCEHHXbnsSoBaTUdxqwoQ75hN5BTBXJMEXp0dkwQbFSEkRw@mail.gmail.com> (raw)
Hi list,
There is a comment on sock_hold() function -
561 /* Grab socket reference count. This operation is valid only
562 when sk is ALREADY grabbed f.e. it is found in hash table
563 or a list and the lookup is made under lock preventing hash table
564 modifications.
565 */
But i could see instances of sock hold() in kernel without any locks.
How the race between sock_hold() and sock_put() is prevented in smp ?
note: I would like to use sock_hold() and sock_put() in
netdev_notifier chain call back functions.
-Ratheesh
next reply other threads:[~2015-06-24 9:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-24 9:17 ratheesh kannoth [this message]
2015-06-24 12:46 ` sock_hold and sock_put Eric Dumazet
2015-06-24 14:14 ` ratheesh kannoth
2015-06-24 15:26 ` Eric Dumazet
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=CAGZFCEHHXbnsSoBaTUdxqwoQ75hN5BTBXJMEXp0dkwQbFSEkRw@mail.gmail.com \
--to=ratheesh.ksz@gmail.com \
--cc=linux-newbie@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).