Eric Dumazet b6c6712a42 net: sk_dst_cache RCUification
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-13 01:41:33 -07:00
..
2010-04-13 01:41:33 -07:00
2009-10-18 18:52:53 -07:00
2010-02-22 16:20:22 -08:00
2009-11-13 20:46:58 -08:00
2010-02-22 16:20:22 -08:00
2010-03-21 18:31:35 -07:00
2009-09-14 17:03:01 -07:00
2009-03-02 03:00:15 -08:00
2009-03-02 03:00:15 -08:00
2010-04-13 01:41:33 -07:00
2010-04-13 01:41:33 -07:00
2009-05-25 22:44:59 -07:00
2010-01-17 19:16:02 -08:00
2009-06-03 02:51:04 -07:00