Peter Wemm 9c9906e912 Plug a mbuf leak in tcp_usr_send(). pru_send() routines are expected
to either enqueue or free their mbuf chains, but tcp_usr_send() was
dropping them on the floor if the tcpcb/inpcb has been torn down in the
middle of a send/write attempt.  This has been responsible for a wide
variety of mbuf leak patterns, ranging from slow gradual leakage to rather
rapid exhaustion.  This has been a problem since before 2.2 was branched
and appears to have been fixed in rev 1.16 and lost in 1.23/1.28.

Thanks to Jayanth Vijayaraghavan <jayanth@yahoo-inc.com> for checking
(extensively) into this on a live production 2.2.x system and that it
was the actual cause of the leak and looks like it fixes it.  The machine
in question was loosing (from memory) about 150 mbufs per hour under
load and a change similar to this stopped it.  (Don't blame Jayanth
for this patch though)

An alternative approach to this would be to recheck SS_CANTSENDMORE etc
inside the splnet() right before calling pru_send() after all the potential
sleeps, interrupts and delays have happened.  However, this would mean
exposing knowledge of the tcp stack's reset handling and removal of the
pcb to the generic code.  There are other things that call pru_send()
directly though.

Problem originally noted by:  John Plevyak <jplevyak@inktomi.com>
1999-06-04 02:27:06 +00:00
..
1999-05-23 13:52:05 +00:00
1998-11-26 18:54:52 +00:00
1998-01-08 23:42:31 +00:00
1999-04-27 11:18:52 +00:00
1998-11-26 18:54:52 +00:00
1999-04-27 11:18:52 +00:00
1999-05-04 07:30:08 +00:00
1998-11-26 18:54:52 +00:00
1999-05-24 10:01:22 +00:00
1998-11-26 18:54:52 +00:00
1998-06-20 18:18:05 +00:00
1999-05-31 11:29:30 +00:00
1998-08-17 01:05:25 +00:00