From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42496 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752128AbeDFM6A (ORCPT ); Fri, 6 Apr 2018 08:58:00 -0400 From: Jeff Moyer To: Christoph Hellwig Cc: Al Viro , Avi Kivity , linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: io_pgetevents & aio fsync V2 References: <20180328072639.16885-1-hch@lst.de> <20180406031630.GU30522@ZenIV.linux.org.uk> <20180406062700.GA20714@lst.de> Date: Fri, 06 Apr 2018 08:57:59 -0400 In-Reply-To: <20180406062700.GA20714@lst.de> (Christoph Hellwig's message of "Fri, 6 Apr 2018 08:27:00 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Christoph Hellwig writes: > On Fri, Apr 06, 2018 at 04:16:30AM +0100, Al Viro wrote: >> BTW, this is only tangentially related, but... does *anything* call >> io_submit() for huge amounts of iocb? I don't know. If an application did that, as many I/Os as could fit into the ring buffer would be submitted, and that's what gets returned from the system call (the number of submitted iocbs). >> Check in do_io_submit() is insane - "no more than MAX_LONG total of >> _pointers_". Compat variant goes for "no more than a page worth of >> pointers" and there's a hard limit in ioctx_alloc() - we can't ever >> get more than 8M slots in ring buffer... > > Logical upper bound for io_submit is nr_events passed to io_setup(), > which is bound by aio_max_nr. Except that we never actually check > against nr_events (or max_reqs as it is known in kernel) in io_submit. > Sigh.. io_submit_one calls aio_get_req which calls get_reqs_available, which is what does the checking for an available ring buffer entry. -Jeff