From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: [PATCH] add support for vectored and async I/O to all simple filesystems Date: Wed, 2 Nov 2005 20:31:05 +0000 Message-ID: <20051102203105.GA20756@mail.shareable.org> References: <20051101023656.GA23724@lst.de> <20051101192000.GB29542@mail.shareable.org> <20051101205745.GB27231@kvack.org> <20051102110630.GB30550@mail.shareable.org> <20051102162107.GA32755@kvack.org> <20051102162904.GK23749@parisc-linux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Benjamin LaHaise , Christoph Hellwig , akpm@osdl.org, linux-fsdevel@vger.kernel.org Return-path: Received: from mail.shareable.org ([81.29.64.88]:19102 "EHLO mail.shareable.org") by vger.kernel.org with ESMTP id S965224AbVKBUbO (ORCPT ); Wed, 2 Nov 2005 15:31:14 -0500 To: Matthew Wilcox Content-Disposition: inline In-Reply-To: <20051102162904.GK23749@parisc-linux.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Matthew Wilcox wrote: > On Wed, Nov 02, 2005 at 11:21:07AM -0500, Benjamin LaHaise wrote: > > On Wed, Nov 02, 2005 at 11:06:30AM +0000, Jamie Lokier wrote: > > > So it means that any program that mustn't block, must now have a > > > stupid kernel version check to make sure it avoids even trying aio > > > system calls? I was under the impression that the right thing to do > > > so far was try them, and when EINVAL is returned, use threads instead. > > > > Yes, that is correct. > > To be fair, the aio system calls were never _guaranteed_ to not block, > were they? ISTR there were various corner cases that would still get > your task blocking while doing an aio submission. Could we have some documentation of when those corner cases occur? The main point of aio, as far as I'm aware, is to avoid the need for threads (or reduce the number of threads) in programs using I/O that shouldn't block, particularly when they are latency sensitive too. If aio has a habit of blocking from time to time, then it may still be useful, but it would be helpful to know that multiple threads are still needed to ensure a program (e.g. such as a HTTP or SMB server) can continue to make progress - and more helpful to know when. One particular question is: can aio calls block for a long time due to network delays (e.g. over NFS) and I/O delays (e.g. slow disk or CD), or are the corner cases restricted to things like paging during memory allocation, which is unavoidable one way or another anyway? -- Jamie