From owner-freebsd-arch@FreeBSD.ORG Tue Jul 29 23:24:12 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 55C91EE7; Tue, 29 Jul 2014 23:24:12 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1475C2576; Tue, 29 Jul 2014 23:24:11 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s6TNO5Dc098239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 29 Jul 2014 16:24:05 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s6TNO4CL098238; Tue, 29 Jul 2014 16:24:05 -0700 (PDT) (envelope-from jmg) Date: Tue, 29 Jul 2014 16:24:04 -0700 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: [CFT/review] new sendfile(2) Message-ID: <20140729232404.GF43962@funkthat.com> Mail-Followup-To: Gleb Smirnoff , arch@freebsd.org References: <20140529102054.GX50679@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140529102054.GX50679@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 29 Jul 2014 16:24:05 -0700 (PDT) Cc: arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2014 23:24:12 -0000 Gleb Smirnoff wrote this message on Thu, May 29, 2014 at 14:20 +0400: > One of the approaches we are experimenting with is new sendfile(2) > implementation, that doesn't block on the I/O done from the file > descriptor. I know this is a reply to an old message, but... How is this different from: SF_NODISKIO. This flag causes any sendfile() call which would block on disk I/O to instead return EBUSY. Busy servers may bene- fit by transferring requests that would block to a separate I/O worker thread. > The patch for review is available at: > > https://phabric.freebsd.org/D102 Not public, so couldn't see the state... > And for those who prefer email attachments, it is also attached. > The patch has 3 logically separate changes in itself: > > 1) Split of socket buffer sb_cc field into sb_acc and sb_ccc. Where > sb_acc stands for "available character count" and sb_ccc is "claimed > character count". This allows us to write a data to a socket, that is > not ready yet. The data sits in the socket, consumes its space, and > keeps itself in the right order with earlier or later writes to socket. > But it can be send only after it is marked as ready. This change is > split across many files. This change really should be split out and possibly committed seperately after a review by the proper people... > 2) A new vnode operation: VOP_GETPAGES_ASYNC(). This one lives in sys/vm. > > 3) Actual implementation of new sendfile(2). This one lives in > kern/uipc_syscalls.c -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."