git: socket/tcp: Implement asynchronized pru_attach for TCP

Sepherosa Ziehau sephe at
Tue Oct 20 00:20:04 PDT 2015

commit c892825ffb53edaa4e5d7270b9254de80099dc53
Author: Sepherosa Ziehau <sephe at>
Date:   Thu Oct 15 21:00:11 2015 +0800

    socket/tcp: Implement asynchronized pru_attach for TCP
    This commit mainly splits TCP pru_attach into two parts:
    - First part operates on socket buffer, so it could run directly in
      the caller thread.
    - The second part creates and initializes tcpcb, which still runs in
      netisr.  But we don't wait for the result of this operation
      (lwkt_sendmsg() is used instead of lwkt_domsg()).
    This removes the last lwkt_domsg on commonly/mostly used socket APIs.
    This is enabled by default and could be disabled by setting sysctl
    kern.ipc.socreate_fast to 0.
    The measured effect of this change on 2-ways E5-2600v2 with Intel 82599
    (10Gbe) using tools/kq_connect_client:
    - Connect rate increases by ~10Kconns/s; we are now doing 395Kconns/s.
    - Idle time on the CPUs not running netisrs increases (55% -> 65%).
    - IPIs rate to the CPUs not running netisrs reduces (40Kipis/s ->

Summary of changes:
 sys/kern/uipc_msg.c      | 28 ++++++++++++++++++++++++++++
 sys/kern/uipc_socket.c   |  9 ++++++++-
 sys/netinet/tcp_usrreq.c | 35 +++++++++++++++++++++++++++--------
 sys/sys/protosw.h        |  2 ++
 sys/sys/socketops.h      |  2 ++
 5 files changed, 67 insertions(+), 9 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list