]> git.baikalelectronics.ru Git - kernel.git/commit
udp: Use hash2 for long hash1 chains in __udp*_lib_mcast_deliver.
authorDavid Held <drheld@google.com>
Wed, 16 Jul 2014 03:28:32 +0000 (23:28 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jul 2014 06:29:52 +0000 (23:29 -0700)
commit71efe09a718185205f89001ff92e868d9e1b16eb
treecab09b28d188606139b1b50b661f42da157c52ba
parentbdb1b3764b6c75f6c2a78e7e921e1e8c18aa0ccd
udp: Use hash2 for long hash1 chains in __udp*_lib_mcast_deliver.

Many multicast sources can have the same port which can result in a very
large list when hashing by port only. Hash by address and port instead
if this is the case. This makes multicast more similar to unicast.

On a 24-core machine receiving from 500 multicast sockets on the same
port, before this patch 80% of system CPU was used up by spin locking
and only ~25% of packets were successfully delivered.

With this patch, all packets are delivered and kernel overhead is ~8%
system CPU on spinlocks.

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