From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GwVZr-0007Es-WB for qemu-devel@nongnu.org; Mon, 18 Dec 2006 22:23:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GwVZq-0007DQ-T9 for qemu-devel@nongnu.org; Mon, 18 Dec 2006 22:23:39 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GwVZq-0007D8-JF for qemu-devel@nongnu.org; Mon, 18 Dec 2006 22:23:38 -0500 Received: from [66.93.172.17] (helo=nevyn.them.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GwVZq-000613-G3 for qemu-devel@nongnu.org; Mon, 18 Dec 2006 22:23:38 -0500 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1GwVZo-0000RG-Gj for qemu-devel@nongnu.org; Mon, 18 Dec 2006 22:23:36 -0500 Date: Mon, 18 Dec 2006 22:23:36 -0500 From: Daniel Jacobowitz Subject: Re: [Qemu-devel] TCP_NODELAY for -redir Message-ID: <20061219032336.GA1632@nevyn.them.org> References: <20061113193027.GA2729@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061113193027.GA2729@nevyn.them.org> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Mon, Nov 13, 2006 at 02:30:27PM -0500, Daniel Jacobowitz wrote: > I was trying to run GDB remote debug tests through a -redir socket > today. It crawled unbelievably. Paul guessed that slirp wasn't using > TCP_NODELAY, and Nagle was to blame. > > He was even righter than usual. Adding TCP_NODELAY speeds up this > particular workload by (very approximately) 54x. See trivial attached > patch. Ping. I still think this patch is a good idea for the reasons previously explained. > Index: qemu/slirp/tcp.h > =================================================================== > --- qemu.orig/slirp/tcp.h 2006-11-13 14:25:24.000000000 -0500 > +++ qemu/slirp/tcp.h 2006-11-13 14:25:29.000000000 -0500 > @@ -112,7 +112,7 @@ struct tcphdr { > /* > * User-settable options (used with setsockopt). > */ > -/* #define TCP_NODELAY 0x01 */ /* don't delay send to coalesce packets */ > +#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ > /* #define TCP_MAXSEG 0x02 */ /* set maximum segment size */ > > /* > Index: qemu/slirp/tcp_subr.c > =================================================================== > --- qemu.orig/slirp/tcp_subr.c 2006-11-13 14:22:34.000000000 -0500 > +++ qemu/slirp/tcp_subr.c 2006-11-13 14:23:31.000000000 -0500 > @@ -499,6 +499,8 @@ tcp_connect(inso) > setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int)); > opt = 1; > setsockopt(s,SOL_SOCKET,SO_OOBINLINE,(char *)&opt,sizeof(int)); > + opt = 1; > + setsockopt(s,IPPROTO_TCP,TCP_NODELAY,(char *)&opt,sizeof(int)); > > so->so_fport = addr.sin_port; > so->so_faddr = addr.sin_addr; > > -- Daniel Jacobowitz CodeSourcery