]> git.baikalelectronics.ru Git - kernel.git/commit
net: speedup udp receive path
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 28 Apr 2010 21:35:48 +0000 (14:35 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Apr 2010 21:35:48 +0000 (14:35 -0700)
commit6bb80dda459421694c9b56a814ebc87e8dc70272
tree16fc7bc990fa47cccb62bdb34cb23bd3c26b7a50
parentd15b56b728012b970ef0013657889d0fb23fb359
net: speedup udp receive path

Since commit 1bca6d2e ([UDP]: Add memory accounting.),
each received packet needs one extra sock_lock()/sock_release() pair.

This added latency because of possible backlog handling. Then later,
ticket spinlocks added yet another latency source in case of DDOS.

This patch introduces lock_sock_bh() and unlock_sock_bh()
synchronization primitives, avoiding one atomic operation and backlog
processing.

skb_free_datagram_locked() uses them instead of full blown
lock_sock()/release_sock(). skb is orphaned inside locked section for
proper socket memory reclaim, and finally freed outside of it.

UDP receive path now take the socket spinlock only once.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/core/datagram.c
net/ipv4/udp.c
net/ipv6/udp.c