freebsd-nq/sys
Bill Fenner dece5b6a43 Introduce (fairly hacky) workaround for odd TCP behavior with application
writes of size (100,208]+N*MCLBYTES.

The bug:
 sosend() hands each mbuf off to the protocol output routine as soon as it
 has copied it, in the hopes of increasing parallelism (see
  http://www.kohala.com/~rstevens/vanj.88jul20.txt ). This works well for
 TCP as long as the first mbuf handed off is at least the MSS.  However,
 when doing small writes (between MHLEN and MINCLSIZE), the transaction is
 split into 2 small MBUF's and each is individually handed off to TCP.
 TCP assumes that the first small mbuf is the whole transaction, so sends
 a small packet.  When the second small mbuf arrives, Nagle prevents TCP
 from sending it so it must wait for a (potentially delayed) ACK.  This
 sends throughput down the toilet.

The workaround:
 Set the "atomic" flag when we're doing small writes.  The "atomic" flag
 has two meanings:
 1. Copy all of the data into a chain of mbufs before handing off to the
    protocol.
 2. Leave room for a datagram header in said mbuf chain.
 TCP wants the first but doesn't want the second.  However, the second
 simply results in some memory wastage (but is why the workaround is a
 hack and not a fix).

The real fix:
 The real fix for this problem is to introduce something like a "requested
 transfer size" variable in the socket->protocol interface.  sosend()
 would then accumulate an mbuf chain until it exceeded the "requested
 transfer size".  TCP could set it to the TCP MSS (note that the
 current interface causes strange TCP behaviors when the MSS > MCLBYTES;
 nobody notices because MCLBYTES > ethernet's MTU).
1998-07-06 19:27:14 +00:00
..
alpha Add the ability to suspend as well as hibernate to the system. This 1998-07-06 06:29:07 +00:00
amd64 There is no such thing any more as "struct bdevsw". 1998-07-04 22:30:26 +00:00
compat remove option LINUX as it did nothing, add DEBUG_LINUX to debug the 1998-06-30 08:40:33 +00:00
compile
conf Forgot to register the IPFIREWALL_FORWARD option. 1998-07-06 04:55:22 +00:00
contrib/softupdates Note which version of Kirk's sources this corresponds to. 1998-06-12 21:21:26 +00:00
ddb Remove the two single step breakpoints in the reverse order of setting to 1998-07-05 10:12:18 +00:00
dev Add the ability to suspend as well as hibernate to the system. This 1998-07-06 06:29:07 +00:00
fs There is no such thing any more as "struct bdevsw". 1998-07-04 22:30:26 +00:00
geom There is no such thing any more as "struct bdevsw". 1998-07-04 22:30:26 +00:00
gnu VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00
i386 "vender" -> "vendor" 1998-07-06 16:10:06 +00:00
isa Add the ability to suspend as well as hibernate to the system. This 1998-07-06 06:29:07 +00:00
isofs/cd9660 There is no such thing any more as "struct bdevsw". 1998-07-04 22:30:26 +00:00
kern Introduce (fairly hacky) workaround for odd TCP behavior with application 1998-07-06 19:27:14 +00:00
libkern #include sys/libkern.h instead of stdlib.h. 1998-06-30 11:05:11 +00:00
miscfs DEVFS completely bypasses the cdevsw and bdevsw tables now. 1998-07-05 23:10:22 +00:00
modules Fix the N'th occurance of missed bits due to opt_???? mucking. 1998-07-02 14:09:44 +00:00
msdosfs VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00
net Removed unused includes. 1998-06-21 14:53:44 +00:00
netatalk Go through the loopback code with a broom.. 1998-06-12 03:48:19 +00:00
netinet oops ended comment before the comment ended.. 1998-07-06 09:10:56 +00:00
netipx When system act as IPX router (sysctl -w net.ipx.ipx.ipxforwarding=1, 1998-06-10 12:52:11 +00:00
netkey Really make this compile.. 1998-04-06 05:11:42 +00:00
netnatm This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
netns Make INET a proper option. 1998-01-08 23:42:31 +00:00
nfs Use u_int32_t in NQFHHASH instead of u_long. 1998-07-05 10:13:22 +00:00
nfsclient VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00
nfsserver Moved `#ifndef NFS_NOSERVER' after including nfs.h. 1998-07-02 12:41:42 +00:00
pc98 Sync with sys/i386/isa/fd.c and wd.c revisions 1.115 and 1.170, 1998-07-06 10:09:42 +00:00
pccard Changed the type of an isa/general interrupt handler to take a 1998-06-18 15:32:09 +00:00
pci Attempt to load serial eeprom contents in both 93c46 and 93c56/66 mode before 1998-07-06 18:38:57 +00:00
posix4 Set PAGE_SIZE for _SC_PAGESIZE sysconf(). 1998-06-01 21:54:43 +00:00
powerpc Add declaration of the NetBSD/alpha bootinfo. 1998-07-05 12:13:18 +00:00
rpc Resolve conflicts. 1997-05-28 04:45:15 +00:00
scsi There is no such thing any more as "struct bdevsw". 1998-07-04 22:30:26 +00:00
sys Shorten line. 1998-07-06 16:07:43 +00:00
tools VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00
ufs VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00
vm Don't truncate the return value of mmap to sizeof(int). 1998-07-05 11:56:52 +00:00
Makefile Test for the existance of ${MACHINE}/boot before trying to build it. 1998-02-20 07:37:08 +00:00