]> git.baikalelectronics.ru Git - kernel.git/commit
udp: add batching to udp_rmem_release()
authorEric Dumazet <edumazet@google.com>
Thu, 8 Dec 2016 19:41:56 +0000 (11:41 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Dec 2016 03:12:21 +0000 (22:12 -0500)
commit09aa8dd9d87c829ee399214f72e062d9ad8a4bba
treeec877d3e324da74f7bbb179d4cd4a8db0172865c
parenta9d9839f7b0943ff6c29a0881c6f6acf4cec0cb2
udp: add batching to udp_rmem_release()

If udp_recvmsg() constantly releases sk_rmem_alloc
for every read packet, it gives opportunity for
producers to immediately grab spinlocks and desperatly
try adding another packet, causing false sharing.

We can add a simple heuristic to give the signal
by batches of ~25 % of the queue capacity.

This patch considerably increases performance under
flood by about 50 %, since the thread draining the queue
is no longer slowed by false sharing.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/udp.h
net/ipv4/udp.c