From: Corey Minyard <minyard@acm.org>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
netdev@vger.kernel.org, paulmck@linux.vnet.ibm.com,
shemminger@vyatta.com
Subject: Re: [PATCH 1/1] Use RCU for the UDP hash lock
Date: Fri, 26 Sep 2008 08:37:33 -0500 [thread overview]
Message-ID: <48DCE59D.6060003@acm.org> (raw)
In-Reply-To: <20080926054600.GA4141@ff.dom.local>
Jarek Poplawski wrote:
> On Thu, Sep 25, 2008 at 10:18:33PM -0500, Corey Minyard wrote:
> ...
>
>> This patch is the second try; I believe I fixed all issues that people
>> raised.
>>
>
> Actually, you've skipped my first question, so I still don't know, why
> you don't use an _init version of sk_del_node (even if it's safe in the
> current implementation), while the non-rcu code uses only this?
>
I guess it didn't matter, but it doesn't matter and consistency is
important, so I've changed it.
-corey
> ...
>
>> diff --git a/include/net/sock.h b/include/net/sock.h
>> index 06c5259..65110a6 100644
>> --- a/include/net/sock.h
>> +++ b/include/net/sock.h
>>
> ...
>
>> static inline int sk_unhashed(const struct sock *sk)
>> {
>> return hlist_unhashed(&sk->sk_node);
>> @@ -361,6 +374,27 @@ static __inline__ int sk_del_node_init(struct sock *sk)
>> return rc;
>> }
>>
>> +static inline int __sk_del_node_rcu(struct sock *sk)
>> +{
>> + if (sk_hashed(sk)) {
>> + hlist_del_rcu(&sk->sk_node);
>> + return 1;
>> + }
>> + return 0;
>> +}
>> +
>> +static inline int sk_del_node_rcu(struct sock *sk)
>> +{
>> + int rc = __sk_del_node_rcu(sk);
>> +
>> + if (rc) {
>> + /* paranoid for a while -acme */
>> + WARN_ON(atomic_read(&sk->sk_refcnt) == 1);
>> + __sock_put(sk);
>> + }
>> + return rc;
>> +}
>>
> ...
>
> Jarek P.
>
>
next prev parent reply other threads:[~2008-09-26 13:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-26 3:18 [PATCH 1/1] Use RCU for the UDP hash lock Corey Minyard
2008-09-26 4:09 ` Paul E. McKenney
2008-09-26 13:49 ` Corey Minyard
2008-09-26 19:50 ` Jarek Poplawski
2008-09-26 5:46 ` Jarek Poplawski
2008-09-26 13:37 ` Corey Minyard [this message]
[not found] <48DB2925.2070908@poczta.onet.pl>
2008-09-24 17:28 ` Corey Minyard
2008-09-24 19:40 ` Stephen Hemminger
2008-09-24 20:46 ` Corey Minyard
2008-09-25 15:29 ` Paul E. McKenney
2008-09-25 15:34 ` Stephen Hemminger
2008-09-25 19:21 ` Corey Minyard
2008-09-25 20:34 ` Stephen Hemminger
2008-09-25 8:45 ` Jarek Poplawski
2008-09-25 19:14 ` Corey Minyard
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=48DCE59D.6060003@acm.org \
--to=minyard@acm.org \
--cc=jarkao2@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=shemminger@vyatta.com \
/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.