-
- Downloads
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>
Showing
- include/net/dst.h 0 additions, 15 deletionsinclude/net/dst.h
- include/net/ip6_route.h 2 additions, 2 deletionsinclude/net/ip6_route.h
- include/net/sock.h 30 additions, 17 deletionsinclude/net/sock.h
- net/core/dev.c 1 addition, 1 deletionnet/core/dev.c
- net/core/sock.c 4 additions, 4 deletionsnet/core/sock.c
- net/dccp/timer.c 2 additions, 2 deletionsnet/dccp/timer.c
- net/decnet/af_decnet.c 3 additions, 3 deletionsnet/decnet/af_decnet.c
- net/ipv4/af_inet.c 1 addition, 1 deletionnet/ipv4/af_inet.c
- net/ipv4/tcp_input.c 2 additions, 2 deletionsnet/ipv4/tcp_input.c
- net/ipv4/tcp_timer.c 2 additions, 2 deletionsnet/ipv4/tcp_timer.c
- net/ipv6/ipv6_sockglue.c 13 additions, 12 deletionsnet/ipv6/ipv6_sockglue.c
Loading
Please register or sign in to comment