From owner-FreeBSD-net-jp@jp.freebsd.org  Tue Jul  7 15:21:11 1998
Received: (from daemon@localhost)
	by jaz.jp.freebsd.org (8.8.8+3.0Wbeta13/8.7.3) id PAA23289;
	Tue, 7 Jul 1998 15:21:11 +0900 (JST)
	(envelope-from owner-FreeBSD-net-jp@jp.FreeBSD.org)
Received: from odin.sat.t.u-tokyo.ac.jp (odin.sat.t.u-tokyo.ac.jp [133.11.156.40])
	by jaz.jp.freebsd.org (8.8.8+3.0Wbeta13/8.7.3) with ESMTP id PAA23275
	for <freebsd-net-jp@jp.freebsd.org>; Tue, 7 Jul 1998 15:21:08 +0900 (JST)
	(envelope-from hideyuki@sat.t.u-tokyo.ac.jp)
Received: by odin.sat.t.u-tokyo.ac.jp (8.8.8/8.7.3) with ESMTP
	id PAA03747; Tue, 7 Jul 1998 15:21:08 +0900 (JST)
To: freebsd-net-jp@jp.freebsd.org
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
	boundary="--Next_Part(Tue_Jul__7_15:11:49_1998_945)--"
Content-Transfer-Encoding: 7bit
Message-Id: <19980707152107F.hideyuki@sat.t.u-tokyo.ac.jp>
Date: Tue, 07 Jul 1998 15:21:07 +0900
From: Hideyuki Suzuki <hideyuki@sat.t.u-tokyo.ac.jp>
X-Dispatcher: imput version 980408
Lines: 74
Reply-To: FreeBSD-net-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute [version 2.1 (Alpha) patchlevel=24e+ JFUG special]
X-Sequence: FreeBSD-net-jp 833
Subject: [FreeBSD-net-jp 833] Fw: cvs commit: src/sys/kern uipc_socket.c
Errors-To: owner-FreeBSD-net-jp@jp.freebsd.org
Sender: owner-FreeBSD-net-jp@jp.freebsd.org

----Next_Part(Tue_Jul__7_15:11:49_1998_945)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

$BNkLZ$G$9!#(B

100bytes $BLdBj$K4X$7$F!$(Bcurrent $B$K$3$s$JJQ99$,F~$C$F$$$^$9!#(B
-- 
Hideyuki Suzuki <hideyuki@sat.t.u-tokyo.ac.jp>
Department of Mathematical Engineering, the University of Tokyo


----Next_Part(Tue_Jul__7_15:11:49_1998_945)--
Content-Type: Message/Rfc822
Content-Transfer-Encoding: 7bit

Path: uno.sat.t.u-tokyo.ac.jp!mail2news
From: Bill Fenner <fenner@FreeBSD.ORG>
Newsgroups: freebsd.cvs-all,freebsd.cvs-sys
Subject: cvs commit: src/sys/kern uipc_socket.c
Date: 07 Jul 1998 04:27:17 +0900
Organization: mail2news (mail to news gateway)
Lines: 41
Distribution: freebsd
Message-ID: <199807061927.MAA23940@freefall.freebsd.org>
NNTP-Posting-Host: uno.sat.t.u-tokyo.ac.jp
To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-sys@FreeBSD.ORG
X-Loop: FreeBSD.org
Precedence: bulk
Xref: uno.sat.t.u-tokyo.ac.jp freebsd.cvs-sys:9122

fenner      1998/07/06 12:27:16 PDT

  Modified files:
    sys/kern             uipc_socket.c 
  Log:
  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).
  
  Revision  Changes    Path
  1.41      +2 -1      src/sys/kern/uipc_socket.c


----Next_Part(Tue_Jul__7_15:11:49_1998_945)----
