freebsd-dev/sys/kern
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
..
bus_if.m [Add missing files from previous commit] 1998-06-14 13:53:12 +00:00
device_if.m [Add missing files from previous commit] 1998-06-14 13:53:12 +00:00
imgact_aout.c Removed unused #includes. 1998-02-20 13:11:54 +00:00
imgact_elf.c Fix a typo which prevented i386 elf from working at all (including Linux 1998-06-08 09:19:35 +00:00
imgact_gzip.c Use copyout() instead of bcopy() to copy the image to user space. 1998-06-16 14:36:40 +00:00
imgact_shell.c Removed unused #includes. 1997-08-02 14:33:27 +00:00
inflate.c Last major round (Unless Bruce thinks of somthing :-) of malloc changes. 1997-10-12 20:26:33 +00:00
init_main.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
init_sysent.c Updated generated files. 1998-06-08 11:08:35 +00:00
init_sysvec.c Translate T_PROTFLT to SIGSEGV instead of SIGBUS when running under 1998-04-28 18:15:08 +00:00
kern_acct.c Moved limit frobbing (and the resulting limcopy()) that occurs for 1998-06-05 21:44:20 +00:00
kern_clock.c Hmm, braino in last commit. 1998-07-04 19:29:15 +00:00
kern_conf.c There is no such thing any more as "struct bdevsw". 1998-07-04 22:30:26 +00:00
kern_descrip.c 64bit fixes: p->p_retval is a register_t[] not an int[]. 1998-06-10 10:27:43 +00:00
kern_exec.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
kern_exit.c Moved limit frobbing (and the resulting limcopy()) that occurs for 1998-06-05 21:44:20 +00:00
kern_fork.c VM level code cleanups. 1998-01-22 17:30:44 +00:00
kern_intr.c Changed the type of an isa/general interrupt handler to take a 1998-06-18 15:32:09 +00:00
kern_ktrace.c Don't depend on "implicit int". 1998-02-20 13:37:40 +00:00
kern_linker.c Use a real malloc type for M_LINKER instead of #defining it as M_TEMP. 1998-01-01 08:56:24 +00:00
kern_lkm.c Remove bdevsw_add(), change the only two users to use bdevsw_add_generic(). 1998-06-25 11:28:07 +00:00
kern_lock.c Really finish supporting compiling with `gcc -ansi'. 1998-04-17 04:53:44 +00:00
kern_lockf.c Make the debug options new-style. 1998-01-31 07:23:16 +00:00
kern_malloc.c Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman) 1998-03-08 09:59:44 +00:00
kern_mib.c Finish _POSIX_PRIORITY_SCHEDULING. Needs P1003_1B and 1998-03-28 11:51:01 +00:00
kern_module.c Remove a bunch of variables which were unused both in GENERIC and LINT. 1997-11-07 08:53:44 +00:00
kern_ntptime.c Introduce std_pps_ioctl() to automagically DTRT. 1998-06-13 09:30:26 +00:00
kern_physio.c There is no such thing any more as "struct bdevsw". 1998-07-04 22:30:26 +00:00
kern_proc.c Staticized. 1998-02-20 13:52:15 +00:00
kern_prot.c 64bit fixes: use size_t not u_int for sizes. 1998-06-10 10:28:29 +00:00
kern_random.c Converted add_interrupt_randomness() to take a `void *' arg. Rewrote 1998-06-21 11:33:32 +00:00
kern_resource.c Some cleanups related to timecounters and weird ifdefs in <sys/time.h>. 1998-05-28 09:30:28 +00:00
kern_shutdown.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
kern_sig.c Added a sysctl variable kern.sugid_coredump for controlling coredump 1998-06-28 08:37:45 +00:00
kern_subr.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
kern_synch.c Add 3 sysctl variables for future use by ps)1_ 1998-06-30 21:25:58 +00:00
kern_sysctl.c Make COMPAT_43 and COMPAT_SUNOS new-style options. 1997-12-16 17:40:42 +00:00
kern_tc.c Hmm, braino in last commit. 1998-07-04 19:29:15 +00:00
kern_threads.c Correct sleep priority. 1998-06-02 05:39:13 +00:00
kern_time.c Add a tc_ prefix to struct timecounter members. 1998-06-09 13:10:54 +00:00
kern_timeout.c Fixed stale references to hzto() in comments. 1998-05-17 20:08:05 +00:00
kern_xxx.c Make COMPAT_43 and COMPAT_SUNOS new-style options. 1997-12-16 17:40:42 +00:00
ksched.c 1. Add new defs for mins and maxs for the POSIX flavor priorities. They 1998-05-19 21:11:53 +00:00
link_aout.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
Make.tags.inc Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not 1997-02-22 09:48:43 +00:00
makedevops.sh [Add missing files from previous commit] 1998-06-14 13:53:12 +00:00
Makefile Remove bogus architectures to allow make tags to work. 1996-03-31 18:53:43 +00:00
makesyscalls.sh Add trailing newline to sys/syscall.mk so that diff doesn't choke on it. 1998-06-28 10:01:52 +00:00
md5c.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
p1003_1b.c Set PAGE_SIZE for _SC_PAGESIZE sysconf(). 1998-06-01 21:54:43 +00:00
posix4_mib.c Finish _POSIX_PRIORITY_SCHEDULING. Needs P1003_1B and 1998-03-28 11:51:01 +00:00
subr_autoconf.c Removed an unused #include. Ifdefed a conditionally used #include. 1997-11-18 12:43:41 +00:00
subr_bus.c Major changes to the generic device framework for FreeBSD/alpha: 1998-06-14 13:46:10 +00:00
subr_clist.c Support compiling with `gcc -ansi'. 1998-04-15 17:47:40 +00:00
subr_disklabel.c Don't depend on "implicit int". 1998-02-20 13:37:40 +00:00
subr_diskmbr.c In all such uses of struct buf: 's/b_un.b_addr/b_data/g' 1997-12-02 21:07:20 +00:00
subr_diskslice.c There is no such thing any more as "struct bdevsw". 1998-07-04 22:30:26 +00:00
subr_dkbad.c In all such uses of struct buf: 's/b_un.b_addr/b_data/g' 1997-12-02 21:07:20 +00:00
subr_log.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
subr_param.c Add 3 sysctl variables for future use by ps)1_ 1998-06-30 21:25:58 +00:00
subr_prf.c Some cleanups related to timecounters and weird ifdefs in <sys/time.h>. 1998-05-28 09:30:28 +00:00
subr_prof.c Oops, the previous commit should have changed i386' to __i386__', 1998-05-01 16:40:21 +00:00
subr_rlist.c Support compiling with `gcc -ansi'. 1998-04-15 17:47:40 +00:00
subr_smp.c Add forwarding of roundrobin to other cpus. This gives a more regular 1998-05-17 22:12:14 +00:00
subr_trap.c Translate T_PROTFLT to SIGSEGV instead of SIGBUS when running under 1998-04-28 18:15:08 +00:00
subr_xxx.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
sys_generic.c 64bit fixes: use u_long not int for ioctl command. 1998-06-10 10:29:31 +00:00
sys_pipe.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
sys_process.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
sys_socket.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
syscalls.c Updated generated files. 1998-06-08 11:08:35 +00:00
syscalls.master This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
sysv_ipc.c Removed an unused #include. Added an unsed #include of <sys/ucred.h> 1997-11-18 12:52:10 +00:00
sysv_msg.c Eradicate the variable "time" from the kernel, using various measures. 1998-03-30 09:56:58 +00:00
sysv_sem.c Eradicate the variable "time" from the kernel, using various measures. 1998-03-30 09:56:58 +00:00
sysv_shm.c Fix the shm panic. I mistakenly used the shadow_count to keep the object 1998-05-04 17:12:53 +00:00
tty_compat.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
tty_conf.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
tty_cons.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
tty_pty.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
tty_snoop.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
tty_subr.c Support compiling with `gcc -ansi'. 1998-04-15 17:47:40 +00:00
tty_tb.c Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not 1997-02-22 09:48:43 +00:00
tty_tty.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
tty.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
uipc_domain.c Convert socket structures to be type-stable and add a version number. 1998-05-15 20:11:40 +00:00
uipc_mbuf.c Update M_EXT support in m_copypacket(). 1998-07-03 08:36:48 +00:00
uipc_proto.c Removed unused includes. 1998-06-21 14:53:44 +00:00
uipc_sockbuf.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
uipc_socket2.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
uipc_socket.c Introduce (fairly hacky) workaround for odd TCP behavior with application 1998-07-06 19:27:14 +00:00
uipc_syscalls.c 64bit fixes: don't cast p->p_retval to an int*. 1998-06-10 10:30:23 +00:00
uipc_usrreq.c Convert socket structures to be type-stable and add a version number. 1998-05-15 20:11:40 +00:00
vfs_aio.c fix braino from yesterdays' megacommit 1998-07-05 20:33:18 +00:00
vfs_bio.c VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00
vfs_cache.c Removed some bogus casts. 1997-12-19 23:18:37 +00:00
vfs_cluster.c VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00
vfs_conf.c Pass lists of possible root devices and their names up to the 1998-06-09 12:52:35 +00:00
vfs_default.c VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00
vfs_export.c Removed unused includes. 1998-06-21 18:02:50 +00:00
vfs_extattr.c Reset MNT_ASYNC flag if needed if unmount() should fail. 1998-07-03 03:47:24 +00:00
vfs_init.c Staticize. 1998-02-09 06:11:36 +00:00
vfs_lookup.c This commit fixes various 64bit portability problems required for 1998-06-07 17:13:14 +00:00
vfs_mount.c Pass lists of possible root devices and their names up to the 1998-06-09 12:52:35 +00:00
vfs_subr.c Removed unused includes. 1998-06-21 18:02:50 +00:00
vfs_syscalls.c Reset MNT_ASYNC flag if needed if unmount() should fail. 1998-07-03 03:47:24 +00:00
vfs_vnops.c Report the mode as the result of the VOP_GETATTR rather than the 1998-06-27 06:43:09 +00:00
vnode_if.pl VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00
vnode_if.sh VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00
vnode_if.src VOP_STRATEGY grows an (struct vnode *) argument 1998-07-04 20:45:42 +00:00