cvs commit: src/sys/kern uipc_socket.c

Robert Watson rwatson at
Sun Jul 11 16:13:14 PDT 2004

rwatson     2004-07-11 23:13:14 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             uipc_socket.c 
  Use sockbuf_pushsync() to synchronize stack and socket buffer state
  in soreceive() after removing an MT_SONAME mbuf from the head of the
  socket buffer.
  When processing MT_CONTROL mbufs in soreceive(), first remove all of
  the MT_CONTROL mbufs from the head of the socket buffer to a local
  mbuf chain, then feed them into dom_externalize() as a set, which
  both avoids thrashing the socket buffer lock when handling multiple
  control mbufs, and also avoids races with other threads acting on
  the socket buffer when the socket buffer mutex is released to enter
  the externalize code.  Existing races that might occur if the protocol
  externalize method blocked during processing have also been closed.
  Now that we synchronize socket buffer and stack state following
  modifications to the socket buffer, turn the manual synchronization
  that previously followed control mbuf processing with a set of
  assertions.  This can eventually be removed.
  The soreceive() code is now substantially more MPSAFE.
  Revision  Changes    Path
  1.201     +47 -34    src/sys/kern/uipc_socket.c

More information about the cvs-all mailing list