1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00
freebsd/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
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
inflate.c
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
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
kern_linker.c
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
kern_malloc.c
kern_mib.c
kern_module.c
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
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
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
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
makedevops.sh [Add missing files from previous commit] 1998-06-14 13:53:12 +00:00
Makefile
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
subr_autoconf.c
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
subr_diskmbr.c
subr_diskslice.c There is no such thing any more as "struct bdevsw". 1998-07-04 22:30:26 +00:00
subr_dkbad.c
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
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
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
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
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