From owner-freebsd-arch@FreeBSD.ORG Thu May 29 00:53:08 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89EF437B401 for ; Thu, 29 May 2003 00:53:08 -0700 (PDT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A6B843F75 for ; Thu, 29 May 2003 00:53:07 -0700 (PDT) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id h4T7r5mF062090; Thu, 29 May 2003 11:53:05 +0400 (MSD) Date: Thu, 29 May 2003 11:53:05 +0400 (MSD) From: Igor Sysoev X-Sender: is@is To: Terry Lambert In-Reply-To: <3ED59AD7.AA0CA6D5@mindspring.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: sendfile(2) SF_NOPUSH flag proposal X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2003 07:53:08 -0000 On Wed, 28 May 2003, Terry Lambert wrote: > Igor Sysoev wrote: > > The portability argument is bogus because sendfile() portability is nonsense. > > Darwin has sendfile. See the released source code: it matches > the FreeBSD semantics, from what I can tell. So now FreeBSD/Darwin is second pair after AIX/MVS that has the same sendfile() prototype. It surely improves the sendfile() portability. Undoubtedly. > > The drawback that really annoyed me is that sendfile() blocks on a reading > > from a disk while a sending to non-blocking socket. Although I see three > > workarounds it's much better to fix this inside sendfile(). > > There's no workaround for the latency issue, which comes from > the fact that a trap handles the request for more pages, and > that blocks all callers. Threads has the same problem in libc_r. The workaround idea is simple - a preloading. But implementation on user level is complex. In FreeBSD 4.x I see three ways: *) the use of aio_read() to read the single bytes; *) the use rfork()ed helper processes to read the single bytes; *) and the use the pool of rfork()ed processes to handle connections. But all of them requires significant changes of an application. > > Five people ? > > Bill Fenner, Matt Dillon, Peter Jeremy, Marc Slemko, Terry Lambert, > Garance Droshin. At time of your mail there were only 4 people, in order of appearance: Peter Jeremy, you, Matt Dillon, and Marc Slemko. Bill Fenner's email was sent one and a half hour after yours and just before my response. Garance Droshin's mail was sent several hours later. Igor Sysoev http://sysoev.ru/en/