From owner-svn-src-head@FreeBSD.ORG Tue Oct 23 15:05:59 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 AD6D3673 for ; Tue, 23 Oct 2012 15:05:59 +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 125208FC1B for ; Tue, 23 Oct 2012 15:05:58 +0000 (UTC) Received: (qmail 86105 invoked from network); 23 Oct 2012 16:43:58 -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 ; 23 Oct 2012 16:43:58 -0000 Message-ID: <5086B24C.9000606@freebsd.org> Date: Tue, 23 Oct 2012 17:05:48 +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: Gleb Smirnoff Subject: Re: svn commit: r241931 - in head/sys: conf kern References: <201210231419.q9NEJjYH082863@svn.freebsd.org> <20121023144211.GX70741@FreeBSD.org> In-Reply-To: <20121023144211.GX70741@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; 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: Tue, 23 Oct 2012 15:05:59 -0000 On 23.10.2012 16:42, Gleb Smirnoff wrote: > On Tue, Oct 23, 2012 at 02:19:45PM +0000, Andre Oppermann wrote: > A> Author: andre > A> Date: Tue Oct 23 14:19:44 2012 > A> New Revision: 241931 > A> URL: http://svn.freebsd.org/changeset/base/241931 > A> > A> Log: > A> Replace the ill-named ZERO_COPY_SOCKET kernel option with two > A> more appropriate named kernel options for the very distinct > A> send and receive path. > A> > A> "options SOCKET_SEND_COW" enables VM page copy-on-write based > A> sending of data on an outbound socket. > A> > A> NB: The COW based send mechanism is not safe and may result > A> in kernel crashes. > A> > A> "options SOCKET_RECV_PFLIP" enables VM kernel/userspace page > A> flipping for special disposable pages attached as external > A> storage to mbufs. > A> > A> Only the naming of the kernel options is changed and their > A> corresponding #ifdef sections are adjusted. No functionality > A> is added or removed. > A> > A> Discussed with: alc (mechanism and limitations of send side COW) > > Users may call this a pointless POLA violation. IMO, the old > kernel option that we had for years, more than a decade, should remain > and just imply two new kernel options. There shouldn't be any users. Zero copy send is broken and responsible for random kernel crashes. Zero copy receive isn't supported by any modern driver. Both are useless to dangerous. The main problem with ZERO_COPY_SOCKETS was that it sounded great and who wouldn't want to have zero copy sockets? Unfortunately it doesn't work that way. According to alc@ even if zero copy send would work it wouldn't be faster due to page based COW setup being a very expensive operation. Eventually he want's page-based COW to go away. For zero copy send we're trying to come up with a sendfile-like approach where the page is simply wired into kernel space. The application then is not allowed to touch it until the socket buffer has released it again. The main issue here is how to provide feedback to the application when it is safe for reuse. For zero copy receive I've been contacted by np@ to find a way to combine DDP into the socket buffer layer. Trying to work something out that isn't too horrible. A generic approach would hinge on page sized mbufs though. -- Andre