From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f193.google.com ([209.85.215.193]:42777 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729900AbeL0Ubs (ORCPT ); Thu, 27 Dec 2018 15:31:48 -0500 Received: by mail-pg1-f193.google.com with SMTP id d72so9170262pga.9 for ; Thu, 27 Dec 2018 12:31:47 -0800 (PST) Subject: Re: [PATCH 09/22] aio: add submission side request cache To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-block@vger.kernel.org, hch@lst.de, viro@zeniv.linux.org.uk References: <20181221192236.12866-1-axboe@kernel.dk> <20181221192236.12866-10-axboe@kernel.dk> <20181227135656.GC25525@infradead.org> From: Jens Axboe Message-ID: Date: Thu, 27 Dec 2018 13:31:44 -0700 MIME-Version: 1.0 In-Reply-To: <20181227135656.GC25525@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 12/27/18 6:56 AM, Christoph Hellwig wrote: >> +/* >> + * After the iocb has been issued, it's safe to be found on the poll list. >> + * Adding the kiocb to the list AFTER submission ensures that we don't >> + * find it from a io_getevents() thread before the issuer is done accessing >> + * the kiocb cookie. >> + */ >> +static void aio_iopoll_iocb_issued(struct aio_submit_state *state, >> + struct aio_kiocb *kiocb) >> +{ >> + if (!state || !IS_ENABLED(CONFIG_BLOCK)) >> + aio_iopoll_iocb_add_list(kiocb); > > This still looks odd to me. Why would be make a batch or not batch > decision based on CONFIG_BLOCK availability? Either batching is safe > for all ops, in which case we should always enabled it, or it only makes > sense for block devices / block backed filesystem in which case we need > a per-operation check. It is safe for any device, but ideally we want the schedule flush to be enabled to not sit on requests if we block. The alternative is to make the plug cb handling available with !CONFIG_BLOCK and not need these checks. -- Jens Axboe