From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 5 09:01:25 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 D34E116A4CE; Wed, 5 Nov 2003 09:01:25 -0800 (PST) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA58B43FFD; Wed, 5 Nov 2003 09:01:23 -0800 (PST) (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 hA5H1CJ6008893; Wed, 5 Nov 2003 20:01:12 +0300 (MSK) (envelope-from is@rambler-co.ru) Date: Wed, 5 Nov 2003 20:01:11 +0300 (MSK) From: Igor Sysoev X-Sender: is@is.park.rambler.ru To: Robert Watson In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: Vivek Pai cc: Alan Cox Subject: Re: Update: Debox sendfile modifications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2003 17:01:26 -0000 On Wed, 5 Nov 2003, Robert Watson wrote: > On Wed, 5 Nov 2003, Igor Sysoev wrote: > > > On Wed, 5 Nov 2003, Robert Watson wrote: > > > > > On Wed, 5 Nov 2003, Igor Sysoev wrote: > > > > > > > As to worker kthreads I think it's better to queue aio operation as it > > > > was made in src/sys/kern/vfs_aio.c:aio_qphysio(). > > > > > > One of the things that worries me about the proposal to use kernel worker > > > threads to perform the I/O is that this can place a fairly low upper bound > > > on effective parallelism, unless the kernel threads themselves can issue > > > the I/O's asynchronously. In the network stack itself, we are event and > > > queue driven without blocking--if we can maintain the apparent semantics > > > to the application, it would be very nice to be able to handle that at the > > > socket layer itself. I.e., not waste a thread + stack per "in-progress" > > > operation, and instead have a worker or two that simply propel operations > > > up and down the stack (similar to geom_up and geom_down). > > > > As far as I understand src/sys/kern/vfs_aio.c:aio_qphysio() (that > > handles AIO on raw disks) does not use kthreads and simply queues > > operations. > > I think it sounds like we're actually agreeing with each other. Yes. > Currently, AIO does use threads for non-character devices, so in the > socket case it will be using a worker thread. Yes, current AIO implementation uses worker threads for regular files. But I suggest not to use AIO code for sendfile() to read a file page. I suggest to use BUF_STRATEGY() like aio_qphysio() does. Is it possible to read a regular file page using BUF_STRATEGY() ? Igor Sysoev http://sysoev.ru/en/