From owner-freebsd-current@FreeBSD.ORG Thu Sep 21 12:29:34 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B57B816A40F for ; Thu, 21 Sep 2006 12:29:34 +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 BBA1043D49 for ; Thu, 21 Sep 2006 12:29:33 +0000 (GMT) (envelope-from andre@freebsd.org) Received: (qmail 38463 invoked from network); 21 Sep 2006 12:32:18 -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 ; 21 Sep 2006 12:32:18 -0000 Message-ID: <451285AE.5030900@freebsd.org> Date: Thu, 21 Sep 2006 14:29:34 +0200 From: Andre Oppermann User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Peter Jeremy References: <4511B9B1.2000903@freebsd.org> <20060921075903.GD960@turion.vk2pj.dyndns.org> In-Reply-To: <20060921075903.GD960@turion.vk2pj.dyndns.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, freebsd-current@freebsd.org Subject: Re: Much improved sendfile(2) kernel implementation X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Sep 2006 12:29:34 -0000 Peter Jeremy wrote: > On Wed, 2006-Sep-20 23:59:13 +0200, Andre Oppermann wrote: >> I have rewritten kern_sendfile() to work in two loops, the inner which turns >> as many pages into mbufs as it can up to the free send socket buffer space. > > The 64K blocks sounds good but how does this interact with TCP slow > start? Is there the possibility that a couple (for some reasonably > large value of 'couple') of TCP connections slowly accepting a file > could eat all the mbuf space? This danger is and has been always present. This normal socket behavior and happens no matter which method (write or sendfile) you use. Even the current sendfile(2) fills the socket buffer when the connection is in slow start. It just spends more CPU once the connection is going and getting throughput (and it doesn't make much use of TSO there). -- Andre