summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_reass.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-12-25 22:23:13 +0000
committerrwatson <rwatson@FreeBSD.org>2004-12-25 22:23:13 +0000
commit203f380ce71b4a11bc70a767c0af75c72d657c74 (patch)
tree1ced03b25cdcb7f070a1fabf142c8060bc0766e2 /sys/netinet/tcp_reass.c
parentc2be0afd648e4aa48678507e52adee803e59a609 (diff)
downloadFreeBSD-src-203f380ce71b4a11bc70a767c0af75c72d657c74.zip
FreeBSD-src-203f380ce71b4a11bc70a767c0af75c72d657c74.tar.gz
Revert parts of tcp_input.c:1.255 associated with the header predicted
cases for tcp_input(): While it is true that the pcbinfo lock provides a pseudo-reference to inpcbs, both the inpcb and pcbinfo locks are required to free an un-referenced inpcb. As such, we can release the pcbinfo lock as long as the inpcb remains locked with the confidence that it will not be garbage-collected. This leads to a less conservative locking strategy that should reduce contention on the TCP pcbinfo lock. Discussed with: sam
Diffstat (limited to 'sys/netinet/tcp_reass.c')
-rw-r--r--sys/netinet/tcp_reass.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index 3eb7fc8..f3b158e 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -1153,6 +1153,8 @@ after_listen:
((tcp_do_newreno || tp->sack_enable) &&
!IN_FASTRECOVERY(tp)))) {
KASSERT(headlocked, ("headlocked"));
+ INP_INFO_WUNLOCK(&tcbinfo);
+ headlocked = 0;
/*
* this is a pure ack for outstanding data.
*/
@@ -1240,6 +1242,8 @@ after_listen:
LIST_EMPTY(&tp->t_segq) &&
tlen <= sbspace(&so->so_rcv)) {
KASSERT(headlocked, ("headlocked"));
+ INP_INFO_WUNLOCK(&tcbinfo);
+ headlocked = 0;
/*
* this is a pure, in-sequence data packet
* with nothing on the reassembly queue and
@@ -2373,6 +2377,8 @@ dodata: /* XXX */
break;
}
}
+ INP_INFO_WUNLOCK(&tcbinfo);
+ headlocked = 0;
#ifdef TCPDEBUG
if (so->so_options & SO_DEBUG)
tcp_trace(TA_INPUT, ostate, tp, (void *)tcp_saveipgen,
@@ -2386,7 +2392,7 @@ dodata: /* XXX */
(void) tcp_output(tp);
check_delack:
- KASSERT(headlocked == 1, ("tcp_input: check_delack: head not locked"));
+ KASSERT(headlocked == 0, ("tcp_input: check_delack: head locked"));
INP_LOCK_ASSERT(inp);
if (tp->t_flags & TF_DELACK) {
tp->t_flags &= ~TF_DELACK;
@@ -2394,7 +2400,6 @@ check_delack:
tcp_timer_delack, tp);
}
INP_UNLOCK(inp);
- INP_INFO_WUNLOCK(&tcbinfo);
return;
dropafterack:
OpenPOWER on IntegriCloud