From owner-freebsd-hackers Thu Jul 22 16:18:27 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (Postfix) with ESMTP id E481F14F5A for ; Thu, 22 Jul 1999 16:18:22 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id QAA17973; Thu, 22 Jul 1999 16:18:19 -0700 (PDT) (envelope-from dillon) Date: Thu, 22 Jul 1999 16:18:19 -0700 (PDT) From: Matthew Dillon Message-Id: <199907222318.QAA17973@apollo.backplane.com> To: "Jason Young" , "Papezik Milon" , Subject: New patch fpr uipc_socket.c (was Squid - a bug in src/sys/kern/uipc_socket.c) References: <000501bed48b$3de34600$8a9791d1@y> <199907222200.PAA88061@apollo.backplane.com> <199907222210.PAA88151@apollo.backplane.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I believe this will solve the previously reported problems. With the original patch if I set net.inet.tcp.sendspace=63 and tried to run xterm from that machine to my local workstation, I got an X error. If I set sendspace=31 the xterm process just locked up and did nothing until I ^C'd it. machine A machine B w/modified kernel w/unmodified kernel (sysctl's on this machine) xterm run on A --> display is on B With this patch I can set net.inet.tcp.sendspace to anything (63, 31, 1, whatever I want) and the xterm will still run. And yes, the xterm is amazingly slow when I set net.inet.tcp.sendspace to 1 :-) This patch is relative to -CURRENT but should also work with -STABLE. -Matt Index: uipc_socket.c =================================================================== RCS file: /home/ncvs/src/sys/kern/uipc_socket.c,v retrieving revision 1.60 diff -u -r1.60 uipc_socket.c --- uipc_socket.c 1999/06/17 23:54:47 1.60 +++ uipc_socket.c 1999/07/22 23:08:38 @@ -413,7 +413,8 @@ register struct mbuf *m; register long space, len, resid; int clen = 0, error, s, dontroute, mlen; - int atomic = sosendallatonce(so) || top; + int atomic = sosendallatonce(so) || top; /* required atomicy */ + int try_atomic = atomic; /* requested atomicy */ if (uio) resid = uio->uio_resid; @@ -518,6 +519,7 @@ mlen = MCLBYTES; len = min(min(mlen, resid), space); } else { + try_atomic = 1; /* try to optimize */ nopages: len = min(min(mlen, resid), space); /* @@ -541,7 +543,7 @@ top->m_flags |= M_EOR; break; } - } while (space > 0 && atomic); + } while (space > 0 && try_atomic); if (dontroute) so->so_options |= SO_DONTROUTE; s = splnet(); /* XXX */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message