From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, paulmck@linux.vnet.ibm.com
Subject: Re: [PATCH net-next-2.6] net: sk_dst_cache RCUification
Date: Tue, 13 Apr 2010 01:52:32 -0700 (PDT) [thread overview]
Message-ID: <20100413.015232.67916764.davem@davemloft.net> (raw)
In-Reply-To: <1270803809.2623.69.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 09 Apr 2010 11:03:29 +0200
> With latest CONFIG_PROVE_RCU stuff, I felt more comfortable to make this
> work.
>
> sk->sk_dst_cache is currently protected by a rwlock (sk_dst_lock)
>
> This rwlock is readlocked for a very small amount of time, and dst
> entries are already freed after RCU grace period. This calls for RCU
> again :)
>
> This patch converts sk_dst_lock to a spinlock, and use RCU for readers.
>
> __sk_dst_get() is supposed to be called with rcu_read_lock() or if
> socket locked by user, so use appropriate rcu_dereference_check()
> condition (rcu_read_lock_held() || sock_owned_by_user(sk))
>
> This patch avoids two atomic ops per tx packet on UDP connected sockets,
> for example, and permits sk_dst_lock to be much less dirtied.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied, thanks for doing this work Eric.
next prev parent reply other threads:[~2010-04-13 8:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-09 9:03 [PATCH net-next-2.6] net: sk_dst_cache RCUification Eric Dumazet
2010-04-13 8:52 ` David Miller [this message]
2010-04-13 23:04 ` Eric Dumazet
2010-04-13 23:11 ` David Miller
2010-04-14 5:35 ` Eric Dumazet
2010-04-14 5:47 ` Eric Dumazet
2010-04-20 23:03 ` [PATCH net-next-2.6] net: sk_sleep() helper Eric Dumazet
2010-04-20 23:39 ` David Miller
2010-04-26 8:20 ` Eric Dumazet
2010-04-26 18:17 ` 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=20100413.015232.67916764.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.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 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 NNTP newsgroup(s).