From: Eric Dumazet <eric.dumazet@gmail.com>
To: "Rémi Denis-Courmont" <remi@remlab.net>
Cc: netdev@vger.kernel.org,
"Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>
Subject: Re: [PATCH net-next] Phonet: use rwlock for sockets list
Date: Fri, 06 Nov 2009 15:00:39 +0100 [thread overview]
Message-ID: <4AF42C07.4050008@gmail.com> (raw)
In-Reply-To: <65081524fbfeb975c842ebc79a8fb038@chewa.net>
Rémi Denis-Courmont a écrit :
> It seems better than a spinlock, assuming that sockets are
> created/destroyed more seldom than they receive packets. And then
> sk_for_each_rcu does not exist. I am sure there is a good reason for that,
> though I wouldn't know. I guess I should try to use RCU hlist_nulls then?
>
spin_lock()/spin_unlock() is faster than read_lock()/read_unlock(), unless
there is contention. (two atomic ops instead of one)
So, unless you have a particular performance problem, it's actually
better to use a spinlock.
If you do have performance problem, a RCU conversion is better than rwlock.
I can do RCU conversion if you ask me...
next prev parent reply other threads:[~2009-11-06 14:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-06 13:41 [PATCH net-next] Phonet: use rwlock for sockets list Rémi Denis-Courmont
2009-11-06 13:44 ` Eric Dumazet
2009-11-06 13:54 ` Rémi Denis-Courmont
2009-11-06 14:00 ` Eric Dumazet [this message]
2009-11-06 14:29 ` Rémi Denis-Courmont
2009-11-07 2:03 ` David Miller
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=4AF42C07.4050008@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=remi.denis-courmont@nokia.com \
--cc=remi@remlab.net \
/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.