From owner-cvs-all@FreeBSD.ORG Fri Jan 12 17:06:54 2007 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8656816A40F; Fri, 12 Jan 2007 17:06:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 1249713C4BA; Fri, 12 Jan 2007 17:06:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id l0CH6mbJ007531; Fri, 12 Jan 2007 12:06:48 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Andre Oppermann Date: Fri, 12 Jan 2007 12:06:46 -0500 User-Agent: KMail/1.9.4 References: <200611021745.kA2HjSZC018731@repoman.freebsd.org> In-Reply-To: <200611021745.kA2HjSZC018731@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701121206.47308.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Fri, 12 Jan 2007 12:06:48 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2437/Thu Jan 11 18:59:09 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern uipc_socket.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jan 2007 17:06:54 -0000 On Thursday 02 November 2006 12:45, Andre Oppermann wrote: > andre 2006-11-02 17:45:28 UTC > > FreeBSD src repository > > Modified files: > sys/kern uipc_socket.c > Log: > Use the improved m_uiotombuf() function instead of home grown sosend_copyin() > to do the userland to kernel copying in sosend_generic() and sosend_dgram(). > > sosend_copyin() is retained for ZERO_COPY_SOCKETS which are not yet supported > by m_uiotombuf(). > > Benchmaring shows significant improvements (95% confidence): > 66% less cpu (or 2.9 times better) with new sosend vs. old sosend (non-TSO) > 65% less cpu (or 2.8 times better) with new sosend vs. old sosend (TSO) > > (Sender AMD Opteron 852 (2.6GHz) with em(4) PCI-X-133 interface and receiver > DELL Poweredge SC1425 P-IV Xeon 3.2GHz with em(4) LOM connected back to back > at 1000Base-TX full duplex.) > > Sponsored by: TCP/IP Optimization Fundraise 2005 > MFC after: 3 month This breaks writes of 0 bytes (e.g. write(s, NULL, 0)) to sockets because m_getm2(NULL, 0, ...) returns NULL and thus m_uiotombuf() returns NULL and sosend_*() now return EFAULT. sosend_copyin() correctly handles this case since it always allocates at least one mbuf. I'm not sure if m_uiotombuf() is at fault or if something else is, so I'll let you fix it. This explains the recent breakage of kcheckpass (KDE screen saver password checker) on current, and possibly other things as well. Also, you've introduced another regression in that if the m_get2m() fails it should be returning ENOBUFS and not EFAULT to userland. The comments in sosend_*() about 'EFAULT being the only possible error' are obviously wrong. :) -- John Baldwin