From owner-svn-src-head@FreeBSD.ORG Thu Oct 18 20:44:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28679CED for ; Thu, 18 Oct 2012 20:44:06 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 7E8E78FC1A for ; Thu, 18 Oct 2012 20:44:05 +0000 (UTC) Received: (qmail 14857 invoked from network); 18 Oct 2012 22:22:56 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 18 Oct 2012 22:22:56 -0000 Message-ID: <50806A10.4070703@freebsd.org> Date: Thu, 18 Oct 2012 22:44:00 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r241703 - head/sys/kern References: <201210182022.q9IKMHFa016360@svn.freebsd.org> In-Reply-To: <201210182022.q9IKMHFa016360@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2012 20:44:06 -0000 On 18.10.2012 22:22, Andre Oppermann wrote: > Author: andre > Date: Thu Oct 18 20:22:17 2012 > New Revision: 241703 > URL: http://svn.freebsd.org/changeset/base/241703 > > Log: > Remove double-wrapping of #ifdef ZERO_COPY_SOCKETS within > zero copy specialized sosend_copyin() helper function. Note that I'm not saying zero copy should be used or is even more performant than the optimized m_uiotombuf() function. Actually there may be some real bit-rot to zero copy sockets. I've just started looking into it. Note that zero copy isn't entirely true either as it marks the page as COW. So when the userspace application reuses the memory it is copied anyway. Also the overhead of doing the VM magic and mbuf attachment of a VM page isn't free either. To really benefit from it an application has to be written with COW in mind and not reuse the memory that was just written to the socket. For non-aware applications it may be a net performance loss overall. Also I don't like the name zero-copy-socket as it promises too much for those not into socket, mbuf and VM magic. I'd rather call it cow-socket or something like that as it describes much better what is actually happening behind the scenes. -- Andre