From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 11 18:34:37 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B92B4F6; Mon, 11 Aug 2014 18:34:37 +0000 (UTC) Received: from mail-ie0-x229.google.com (mail-ie0-x229.google.com [IPv6:2607:f8b0:4001:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7984C20F8; Mon, 11 Aug 2014 18:34:37 +0000 (UTC) Received: by mail-ie0-f169.google.com with SMTP id rd18so10487246iec.28 for ; Mon, 11 Aug 2014 11:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=hqkOnNKr3RAdTdokn/2VS7jsiaf2dhI0CqeR4DdVNAE=; b=gD0rybZ8oh4eX2TNM3OdUQJyI+hNf2Yg+7KgoIgR/JZeJyD2Zm2Vt8uz6QPgyKwLjO yURW6iqfdI3PCsWchS9i9CChyfHZ3siNh37mHuusKb5KtpgAU3mzb4cotXzvnpAk6h3x u+dUFbteR6j5H6fmBtlsrq/13UDOHk0ycFUazJ+Z3mz2ogsoNWTBhjrhIF15k9an67kw LQSQDSAw1tOY1uJusw/yU9LKXfWCcT2zlbGKtglnv7HCCI4uBje3PuisWrJMeMXyZRsN uCoMvA1WZ84PnWN1kViVgTBMj8KOfhFXDOHnb+wIXx9KKk4VqF9Hy28deYQ79nZF3EZy 2HUg== MIME-Version: 1.0 X-Received: by 10.50.66.197 with SMTP id h5mr32950757igt.34.1407782076742; Mon, 11 Aug 2014 11:34:36 -0700 (PDT) Received: by 10.43.17.196 with HTTP; Mon, 11 Aug 2014 11:34:36 -0700 (PDT) Reply-To: alc@freebsd.org In-Reply-To: References: <1407171616.44440.YahooMailBasic@web181702.mail.ne1.yahoo.com> <20140811082610.GF7828@equilibrium.bsdes.net> Date: Mon, 11 Aug 2014 13:34:36 -0500 Message-ID: Subject: Re: Support for zero copy sockets From: Alan Cox To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: Victor Balada Diaz , Sushanth Rai , "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2014 18:34:37 -0000 The send path used an ad hoc copy-on-write mechanism, i.e., it was not the mechanism used by fork, etc. This mechanism was broken (and as I'll argue in a few sentences not worth fixing). The receive path used page flipping and required support from the NIC. Neither copy-on-write nor page flipping are viable approaches on today's multicore machines because their implementation entails interprocessor TLB shootdowns. Let them rest in peace. On Mon, Aug 11, 2014 at 1:04 PM, Adrian Chadd wrote: > On 11 August 2014 01:26, Victor Balada Diaz wrote: > > On Mon, Aug 04, 2014 at 10:00:16AM -0700, Sushanth Rai via > freebsd-hackers wrote: > >> Hello, > >> > >> FreeBSD 10 release sources doesn't seem to have zero copy socket code > anymore. What's is alternative to do zero_copy ? > >> > >> Thanks, > >> Sushanth > > > > You need to use sendfile(2). In the man page is stated that the > implementation in FreeBSD > > is zero copy. > > > > You can also check: > > > > http://svnweb.freebsd.org/base?view=revision&revision=255608 > > > > I'd like to reintroduce a zero copy socket IO method for at least > write that doesn't rely on sendfile. > > The zero-copy socket page flipping thing was interesting because IIRC > tried to work for both sending and receiving socket data. Doing that > via an API would be nicer. > > So, if people have an idea for how it could be done / what the API > looks like then I'm all ears. > > > > -a > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >