cvs commit: src/sys/kern uipc_sockbuf.c uipc_socket.c src/sys/sys socketvar.h

Robert Watson rwatson at
Tue Aug 1 10:30:27 UTC 2006

rwatson     2006-08-01 10:30:26 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             uipc_sockbuf.c uipc_socket.c 
    sys/sys              socketvar.h 
  Reimplement socket buffer tear-down in sofree(): as the socket is no
  longer referenced by other threads (hence our freeing it), we don't need
  to set the can't send and can't receive flags, wake up the consumers,
  perform two levels of locking, etc.  Implement a fast-path teardown,
  sbdestroy(), which flushes and releases each socket buffer.  A manual
  dom_dispose of the receive buffer is still required explicitly to GC
  any in-flight file descriptors, etc, before flushing the buffer.
  This results in a 9% UP performance improvement and 16% SMP performance
  improvement on a tight loop of socket();close(); in micro-benchmarking,
  but will likely also affect CPU-bound macro-benchmark performance.
  Revision  Changes    Path
  1.163     +53 -13    src/sys/kern/uipc_sockbuf.c
  1.276     +22 -14    src/sys/kern/uipc_socket.c
  1.154     +1 -0      src/sys/sys/socketvar.h

More information about the cvs-src mailing list