Skip to content
Commit df560056 authored by Eric Garver's avatar Eric Garver Committed by David S. Miller
Browse files

udp: inuse checks can quit early for reuseport



UDP lib inuse checks will walk the entire hash bucket to check if the
portaddr is in use. In the case of reuseport we can stop searching when
we find a matching reuseport.

On a 16-core VM a test program that spawns 16 threads that each bind to
1024 sockets (one per 10ms) takes 1m45s. With this change it takes 11s.

Also add a cond_resched() when the port is not specified.

Signed-off-by: default avatarEric Garver <e@erig.me>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 89eb9835
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment