tcp: Let sosendtcp() call tcp_usrreq.pru_send asynchronous
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 23 Oct 2011 12:55:16 +0000 (20:55 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 24 Oct 2011 12:06:28 +0000 (20:06 +0800)
commit0ad8e15ea0059b225c9aa255b844cb9ec48d5227
tree987365e7761df4da014b6a77f4d67c627d8bc0da
parent5bc42dd14c6c9a541415424982d9c45a3888ea09
tcp: Let sosendtcp() call tcp_usrreq.pru_send asynchronous

- Embed netmsg_pru_send into mbuf.m_hdr, which shares the space with
  netmsg_pru_packet.
- Use the newly added netmsg_pru_send in mbuf to perform asynchronous
  pru_send.  For asynchronous pru_send, PRUS_NOREPLY is added, which
  prevents pru_send to reply the message.
- In sosendtcp(), if we have more data to call pru_send, we call it
  asynchronously.  The last piece of data or OOB data will still be
  passed to pru_send synchronously.

On Phenom 9550 (4 core, 2.2GHz):
8 parallel netperf -H 127.0.0.1 (4 runs, unit: Mbps)

old  5863.85  5773.13  5534.14  5506.72
new  6735.98  6903.13  6971.89  7056.66

This give ~20% performance improvement.

It has no obvious impact on 1000BaseT or 100baseTX network performace.
sys/kern/uipc_msg.c
sys/kern/uipc_socket.c
sys/net/netmsg.h
sys/netinet/tcp_usrreq.c
sys/sys/mbuf.h
sys/sys/socketops.h