diff options
author | Eric Dumazet <edumazet@google.com> | 2016-02-11 16:28:49 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-12 05:28:32 -0500 |
commit | 1580ab63fc9a03593072cc5656167a75c4f1d173 (patch) | |
tree | 5a8fe8b98df62f6bc8ae18b1aec8a7215622c628 /net/sched/cls_u32.c | |
parent | 3134b9f019f2604f05fd65a2c2d4e57193f7ddfb (diff) |
tcp/dccp: better use of ephemeral ports in connect()
In commit 07f4c90062f8 ("tcp/dccp: try to not exhaust ip_local_port_range
in connect()"), I added a very simple heuristic, so that we got better
chances to use even ports, and allow bind() users to have more available
slots.
It gave nice results, but with more than 200,000 TCP sessions on a typical
server, the ~30,000 ephemeral ports are still a rare resource.
I chose to go a step further, by looking at all even ports, and if none
was available, fallback to odd ports.
The companion patch does the same in bind(), but in opposite way.
I've seen exec times of up to 30ms on busy servers, so I no longer
disable BH for the whole traversal, but only for each hash bucket.
I also call cond_resched() to be gentle to other tasks.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_u32.c')
0 files changed, 0 insertions, 0 deletions