diff options
author | glebius <glebius@FreeBSD.org> | 2006-09-06 13:56:35 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2006-09-06 13:56:35 +0000 |
commit | d907e70991e5532d54d44116c5a0b2cc5387db64 (patch) | |
tree | 031fd47798744592737db92ae3ba63935183153b /sys/netinet/tcp_subr.c | |
parent | 1b7ae73acb536e1260e21e970525999d59fdb060 (diff) | |
download | FreeBSD-src-d907e70991e5532d54d44116c5a0b2cc5387db64.zip FreeBSD-src-d907e70991e5532d54d44116c5a0b2cc5387db64.tar.gz |
o Backout rev. 1.125 of in_pcb.c. It appeared to behave extremely
bad under high load. For example with 40k sockets and 25k tcptw
entries, connect() syscall can run for seconds. Debugging showed
that it iterates the cycle millions times and purges thousands of
tcptw entries at a time.
Besides practical unusability this change is architecturally
wrong. First, in_pcblookup_local() is used in connect() and bind()
syscalls. No stale entries purging shouldn't be done here. Second,
it is a layering violation.
o Return back the tcptw purging cycle to tcp_timer_2msl_tw(),
that was removed in rev. 1.78 by rwatson. The commit log of this
revision tells nothing about the reason cycle was removed. Now
we need this cycle, since major cleaner of stale tcptw structures
is removed.
o Disable probably necessary, but now unused
tcp_twrecycleable() function.
Reviewed by: ru
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 05451e3..22a5e26 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1808,6 +1808,7 @@ tcp_twstart(struct tcpcb *tp) INP_UNLOCK(inp); } +#if 0 /* * The appromixate rate of ISN increase of Microsoft TCP stacks; * the actual rate is slightly higher due to the addition of @@ -1822,10 +1823,6 @@ tcp_twstart(struct tcpcb *tp) * Determine if the ISN we will generate has advanced beyond the last * sequence number used by the previous connection. If so, indicate * that it is safe to recycle this tw socket by returning 1. - * - * XXXRW: This function should assert the inpcb lock as it does multiple - * non-atomic reads from the tcptw, but is currently called without it from - * in_pcb.c:in_pcblookup_local(). */ int tcp_twrecycleable(struct tcptw *tw) @@ -1833,6 +1830,7 @@ tcp_twrecycleable(struct tcptw *tw) tcp_seq new_iss = tw->iss; tcp_seq new_irs = tw->irs; + INP_INFO_WLOCK_ASSERT(&tcbinfo); new_iss += (ticks - tw->t_starttime) * (ISN_BYTES_PER_SECOND / hz); new_irs += (ticks - tw->t_starttime) * (MS_ISN_BYTES_PER_SECOND / hz); @@ -1841,6 +1839,7 @@ tcp_twrecycleable(struct tcptw *tw) else return (0); } +#endif void tcp_twclose(struct tcptw *tw, int reuse) |