From owner-freebsd-hackers Wed Apr 21 20:37:35 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from hydrogen.fircrest.net (metriclient-3.uoregon.edu [128.223.172.3]) by hub.freebsd.org (Postfix) with ESMTP id 85D4B15439 for ; Wed, 21 Apr 1999 20:37:18 -0700 (PDT) (envelope-from gurney_j@efn.org) Received: (from jmg@localhost) by hydrogen.fircrest.net (8.9.1/8.8.7) id UAA27277; Wed, 21 Apr 1999 20:34:38 -0700 (PDT) Message-ID: <19990421203437.35158@hydrogen.nike.efn.org> Date: Wed, 21 Apr 1999 20:34:37 -0700 From: John-Mark Gurney To: Christopher Sedore Cc: hackers@FreeBSD.ORG Subject: Re: aio_suspend() functionality References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.69 In-Reply-To: ; from Christopher Sedore on Wed, Apr 21, 1999 at 10:25:18PM -0400 Reply-To: John-Mark Gurney Organization: Cu Networking X-Operating-System: FreeBSD 3.0-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/ Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Christopher Sedore scribbled this message on Apr 21: > > I sent a message a day or two ago asking if anyone had looked into > changing the behavior of aio_suspend so that it did not require a list of > aiocb's, but rather would accept an array of null pointers, and then fill > them in for you when an operation completed. > > A patch to vfs_aio.c that does just this is available at > ftp://ftp.maxwell.syr.edu/freebsd/vfs_aio.c-aio_suspend-patch thanks for doing the work.... > Why would one care about this? If one were going to have hundreds (or > thousands) of outstanding asynchronous IO requests, it isn't very I wish this was possible.. you can only queue 256 and have 32 active at once right now... sounds like we need to LINT some more options for this... > efficient to handle them buy building arrays of pointers to control blocks > and then polling each one to determine whether or not it has completed, > particularly since the kernel already has them in a handy list. > > It essentially allows you to use aiocb's as fire and forget: malloc one > (possibly "growing it" to keep your own state), give it to the OS with > aio_read/aio_write, then simply poll for completed events using > aio_suspend. When an operation completes, you'll get the pointer to the > aiocb back. > > This patch is against FreeBSD 3.1-STABLE It works in my testing, and > is not entirely backwardly compatible with the old aio_suspend (it won't > behave the same way if you pass in an array of all NULL pointers, > otherwise it should be functionally equivalent). I've been trying to get Dyson's attention about aio too... there is one major problem with the code that allows any user that can do aio to panic the system... also it doesn't honor the FREAD flag on a descriptor... if you have a descriptor open just for writing, you can read from it with aio... I have fixes for both of these bugs... but right now I don't have a machine to do -current testing on, so I won't be able to throughly be able to test the patches... > The patch will generate a warning during compiling because the upper > layers pointing to aio_suspend expect the array of pointers to be a const, > and I deconstify it. we should find out what DG and bde think about this change... it is a nice change, though we need to evaluate what it does to the standard.. one thing we might look at is just using a new aio_sleep function that provides this functionality... -- John-Mark Gurney Voice: +1 541 684 8449 Cu Networking P.O. Box 5693, 97405 "The soul contains in itself the event that shall presently befall it. The event is only the actualizing of its thought." -- Ralph Waldo Emerson To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message