Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jun 1999 19:27:08 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/kern uipc_socket.c src/sys/netinet tcp_usrreq.c
Message-ID:  <199906040227.TAA65712@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
peter       1999/06/03 19:27:07 PDT

  Modified files:
    sys/kern             uipc_socket.c 
    sys/netinet          tcp_usrreq.c 
  Log:
  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>
  
  Revision  Changes    Path
  1.59      +10 -1     src/sys/kern/uipc_socket.c
  1.44      +28 -7     src/sys/netinet/tcp_usrreq.c



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906040227.TAA65712>