From owner-freebsd-arch@FreeBSD.ORG Sun Aug 31 16:50:25 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6540ABA8 for ; Sun, 31 Aug 2014 16:50:25 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DE8171BEB for ; Sun, 31 Aug 2014 16:50:24 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s7VGoMGZ087310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 31 Aug 2014 20:50:22 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s7VGoMGL087309 for arch@freebsd.org; Sun, 31 Aug 2014 20:50:22 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 31 Aug 2014 20:50:22 +0400 From: Gleb Smirnoff To: arch@freebsd.org Subject: Re: [CFT/review] new sendfile(2) Message-ID: <20140831165022.GE7693@FreeBSD.org> References: <20140529102054.GX50679@FreeBSD.org> <20140729232404.GF43962@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140729232404.GF43962@funkthat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 16:50:25 -0000 John-Mark, On Tue, Jul 29, 2014 at 04:24:04PM -0700, John-Mark Gurney wrote: J> Gleb Smirnoff wrote this message on Thu, May 29, 2014 at 14:20 +0400: J> > One of the approaches we are experimenting with is new sendfile(2) J> > implementation, that doesn't block on the I/O done from the file J> > descriptor. J> J> I know this is a reply to an old message, but... I am also sorry for late reply on late reply :) J> How is this different from: J> SF_NODISKIO. This flag causes any sendfile() call which would J> block on disk I/O to instead return EBUSY. Busy servers may bene- J> fit by transferring requests that would block to a separate I/O J> worker thread. It is very different. New sendfile(2) simply doesn't block and returns success :) The I/O completes outside of syscall context. J> > 1) Split of socket buffer sb_cc field into sb_acc and sb_ccc. Where J> > sb_acc stands for "available character count" and sb_ccc is "claimed J> > character count". This allows us to write a data to a socket, that is J> > not ready yet. The data sits in the socket, consumes its space, and J> > keeps itself in the right order with earlier or later writes to socket. J> > But it can be send only after it is marked as ready. This change is J> > split across many files. J> J> This change really should be split out and possibly committed seperately J> after a review by the proper people... Of course. It actually makes 80% of the volume of the patch. -- Totus tuus, Glebius.