From owner-freebsd-arch@FreeBSD.ORG Fri May 30 02:23:05 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 C357137B401 for ; Fri, 30 May 2003 02:23:05 -0700 (PDT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C57543F3F for ; Fri, 30 May 2003 02:23:04 -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 h4U9N2mF089976; Fri, 30 May 2003 13:23:02 +0400 (MSD) Date: Fri, 30 May 2003 13:23:02 +0400 (MSD) From: Igor Sysoev X-Sender: is@is To: Terry Lambert In-Reply-To: <3ED71B19.339E8A95@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: Fri, 30 May 2003 09:23:06 -0000 On Fri, 30 May 2003, Terry Lambert wrote: > Igor Sysoev wrote: > > > FreeBSD, NetBSD, OpenBSD, Darwin. > > > > There's no sendfile() implementation in NetBSD and OpenBSD. If you > > apply some experimental patch you can easy fix some non-portable issues. > > Or you could just fix sendfile. 8-). I'm going to fix it as Matthew Dillon suggested if no one else is going to do it in the near future. > > By the way what's about kqueue(2) ? Are you not confused that NetBSD > > does not support EVFILT_AIO and OpenBSD does not support EVFILT_AIO and > > EVFILT_TIMER ? Does this mean that FreeBSD should not introduce any > > new kqueue filters or flags ? > > These are incredibly trivial to support. I estimate the work > at an hour each, including writing a unit test. It took me > about an hour to write the SystemV IPC Message Queue KNOTE() > code for FreeBSD. Nevetheless there's no support for EVFILT_AIO and EVFILT_TIMER. By the way I do not think that EVFILT_AIO is a trivial thing. Actually it requires at least the working AIO enviroment in the kernel. Now we have more portable kqueue() that exists in FreeBSD, NetBSD, and OpenBSD (I do not know about Darwin and MacOS X) with the same prototype and some unsupported filters. And we have much less portable sendfile() that exists in the most modern unices but with the different prototypes and functionality. > > I agree but I told not about the blocking on a page fault but the blocking > > on the reading the file page from a disk by sendfile(). These pages > > can be preloaded. > > It doesn't "read" it, per se: it creates a mapping, and it > faults the pages; when they are in core, then they can be > sent. So what do these lines in /sys/kern/uipc_syscalls.c:sendfile(): if (!pg->valid || !vm_page_is_valid(pg, pgoff, xfsize)) { .... error = VOP_READ(vp, &auio, IO_VMIO | ((MAXBSIZE / bsize) << 16), p->p_ucred); .... } Igor Sysoev http://sysoev.ru/en/