Return-Path: Received: from mail-pg1-f196.google.com ([209.85.215.196]:46184 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729997AbeL0Uet (ORCPT ); Thu, 27 Dec 2018 15:34:49 -0500 Received: by mail-pg1-f196.google.com with SMTP id w7so9164888pgp.13 for ; Thu, 27 Dec 2018 12:34:49 -0800 (PST) Subject: Re: [PATCH 19/22] aio: support kernel side submission for aio with SCQRING 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-20-axboe@kernel.dk> <20181227135753.GE25525@infradead.org> From: Jens Axboe Message-ID: <48838356-101d-d1f6-9b84-9d5a502dd5b7@kernel.dk> Date: Thu, 27 Dec 2018 13:34:46 -0700 MIME-Version: 1.0 In-Reply-To: <20181227135753.GE25525@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:57 AM, Christoph Hellwig wrote: > On Fri, Dec 21, 2018 at 12:22:33PM -0700, Jens Axboe wrote: >> If an application sets IOCTX_FLAG_SCQTHREAD, the io_context gets a >> single thread backing. If used with buffered IO, this will limit >> the device queue depth to 1, but it will be async, IOs will simply >> be serialized. >> >> Or an application can set IOCTX_FLAG_SQWQ, in which case the io_context >> gets a work queue backing. The concurrency level is the mininum of >> twice the available CPUs, or the queue depth specific for the context. >> For this mode, we attempt to do buffered reads inline, in case they are >> cached. So we should only punt to a workqueue, if we would have to block >> to get our data. > > I'm really worried about having this code present twice. Do we have > strong use cases for both? Can't we emulate IOCTX_FLAG_SCQTHREAD good > enough with a workqueue without concurrency management? A work item is not a good fit for this. If we want the polled submission, which I think is pretty nifty, then you need a higher context than a wq item that comes and goes. -- Jens Axboe