From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 26 09:57:32 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B154C16A4B3 for ; Sun, 26 Oct 2003 09:57:32 -0800 (PST) Received: from mail.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C5B443F85 for ; Sun, 26 Oct 2003 09:57:31 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 29401 invoked from network); 26 Oct 2003 17:57:30 -0000 Received: from unknown (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail6.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 26 Oct 2003 17:57:30 -0000 Received: from hydrogen.funkthat.com (vcpahe@localhost.funkthat.com [127.0.0.1])h9QHvTgP066491; Sun, 26 Oct 2003 09:57:30 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id h9QHvQa5066490; Sun, 26 Oct 2003 09:57:26 -0800 (PST) Date: Sun, 26 Oct 2003 09:57:26 -0800 From: John-Mark Gurney To: vivek@CS.Princeton.EDU Message-ID: <20031026175726.GC558@funkthat.com> Mail-Followup-To: vivek@CS.Princeton.EDU, Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , freebsd-hackers@freebsd.org, Q , Kris Kennaway References: <1066789354.21430.39.camel@boxster.onthenet.com.au> <20031022082953.GA69506@rot13.obsecurity.org> <1066816287.25609.34.camel@boxster.onthenet.com.au> <20031022095754.GA70026@rot13.obsecurity.org> <1066820436.25609.93.camel@boxster.onthenet.com.au> <1067183332.3f9bece4c0cf4@webmail.cs.princeton.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1067183332.3f9bece4c0cf4@webmail.cs.princeton.edu> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 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 cc: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= cc: Kris Kennaway cc: Q cc: freebsd-hackers@freebsd.org Subject: Re: Some mmap observations compared to Linux 2.6/OpenBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2003 17:57:32 -0000 vivek@CS.Princeton.EDU wrote this message on Sun, Oct 26, 2003 at 10:48 -0500: > We decided to avoid all mmap/mincore operations, and opted to instead > add a flag to sendfile such that we can try sendfile and have it return > an error (instead of blocking) when a page isn't in memory. I was thinking about this myself, but how do you prevent spinning on the sendfile waiting for the page to become available? You have the send space to wait for on the socket, but there is no equivalent kqueue event to wait for when a page becomes available. Do you simply always spin on sendfile since the socket keeps returning available for writing? I have a similar web server design that I wrote at the end of last year, and your paper brought to light to problems of sendfile, so I have been thinking of switching to async io, since there you can get completion status when the io completes. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."