freebsd-dev/sys
Andre Oppermann d99b0dd2c5 Rewrite kern_sendfile() to work in two loops, the inner which turns as many
VM pages into mbufs as it can -- up to the free send socket buffer space.
The outer loop then drops the whole mbuf chain into the send socket buffer,
calls tcp_output() on it and then waits until 50% of the socket buffer are
free again to repeat the cycle. This way tcp_output() gets the full amount
of data to work with and can issue up to 64K sends for TSO to chop up in
the network adapter without using any CPU cycles. Thus it gets very efficient
especially with the readahead the VM and I/O system do.

The previous sendfile(2) code simply looped over the file, turned each 4K
page into an mbuf and sent it off. This had the effect that TSO could only
generate 2 packets per send instead of up to 44 at its maximum of 64K.

Add experimental SF_MNOWAIT flag to sendfile(2) to return ENOMEM instead of
sleeping on mbuf allocation failures.

Benchmarking shows significant improvements (95% confidence):
 45% less cpu (or 1.81 times better) with new sendfile vs. old sendfile (non-TSO)
 83% less cpu (or 5.7 times better) with new sendfile vs. old sendfile (TSO)

(Sender AMD Opteron 852 (2.6GHz) with em(4) PCI-X-133 interface and receiver
DELL Poweredge SC1425 P-IV Xeon 3.2GHz with em(4) LOM connected back to back
at 1000Base-TX full duplex.)

Sponsored by:	TCP/IP Optimization Fundraise 2005
MFC after:	3 month
2006-11-02 16:53:26 +00:00
..
amd64 Add a cnputs() function to write a string to the console with 2006-11-01 04:54:51 +00:00
arm Do not include both <sys/types.h> and <sys/param.h>, it is a style bug as 2006-11-01 12:41:43 +00:00
boot Sync the EFI headers with version 1.10.14.62 of the Intel sample EFI 2006-11-02 02:42:48 +00:00
bsm
cam 2nd and final commit that moves us to CAM_NEW_TRAN_CODE 2006-11-02 00:54:38 +00:00
coda
compat Backout the linux aio stuff. Several problems where identified and the 2006-10-29 14:02:39 +00:00
conf 2nd and final commit that moves us to CAM_NEW_TRAN_CODE 2006-11-02 00:54:38 +00:00
contrib Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
crypto Initialize T1 to silent gcc warning. 2006-10-22 02:19:33 +00:00
ddb On trap while inside ddb, the trap handler calls kdb_reenter(), that 2006-11-02 11:47:38 +00:00
dev Use 2K Login f/w. 2006-11-02 03:23:01 +00:00
fs Make KSE a kernel option, turned on by default in all GENERIC 2006-10-26 21:42:22 +00:00
gdb Convert to new console api 2006-05-26 13:54:27 +00:00
geom Fix ia64 build breakage. 2006-11-02 16:24:18 +00:00
gnu
i4b
i386 Add a cnputs() function to write a string to the console with 2006-11-01 04:54:51 +00:00
ia64 Add a cnputs() function to write a string to the console with 2006-11-01 04:54:51 +00:00
isa Use calendaric calculation support from subr_clock.c instead of home-rolled. 2006-10-02 16:18:40 +00:00
isofs/cd9660
kern Rewrite kern_sendfile() to work in two loops, the inner which turns as many 2006-11-02 16:53:26 +00:00
libkern
modules Hook up gjournal bits to the build. 2006-10-31 22:22:30 +00:00
net Do not test all the conditions if the port is already forwarding. Also print a 2006-11-02 08:44:19 +00:00
net80211
netatalk Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
netatm
netgraph
netinet - Use non-recursive mutex. MTX_RECURSE is unnecessary since rev. 1.70 2006-10-29 12:09:24 +00:00
netinet6 Complete break-out of sys/sys/mac.h into sys/security/mac/mac_framework.h 2006-10-22 11:52:19 +00:00
netipsec
netipx
netkey
netnatm
netncp
netsmb Fix misalignment bugs caused by invalid type casts of pointers 2006-08-22 03:05:51 +00:00
nfs
nfs4client
nfsclient Make EWOULDBLOCK a recoverable error so that the request is retransmitted. 2006-10-31 20:25:37 +00:00
nfsserver Fix leak in NAMEI zone caused by nfs server when VOP_RENAME fails. 2006-10-26 12:41:53 +00:00
opencrypto
pc98 Remove the KSE option now that it's in DEFAULTS on these arches/machines. 2006-10-26 22:11:35 +00:00
pccard
pci 2nd and final commit that moves us to CAM_NEW_TRAN_CODE 2006-11-02 00:54:38 +00:00
posix4 Make KSE a kernel option, turned on by default in all GENERIC 2006-10-26 21:42:22 +00:00
powerpc Add a cnputs() function to write a string to the console with 2006-11-01 04:54:51 +00:00
rpc
security Forward declare struct cdev, since arguments of this type are used in 2006-10-30 15:20:49 +00:00
sparc64 - In sunkbd_probe_keyboard() don't bother to determine the keyboard layout 2006-11-02 00:01:15 +00:00
sun4v Spaces to tabs. (I shouldn't copy and paste from diff output to a terminal) 2006-11-01 21:33:17 +00:00
sys Rewrite kern_sendfile() to work in two loops, the inner which turns as many 2006-11-02 16:53:26 +00:00
tools
ufs Aquire Giant in the softdep_flush for clear_remove() and clear_inodedeps() 2006-11-01 13:48:44 +00:00
vm Make KSE a kernel option, turned on by default in all GENERIC 2006-10-26 21:42:22 +00:00
Makefile