From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:58405 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730404AbeLULUj (ORCPT ); Fri, 21 Dec 2018 06:20:39 -0500 Date: Fri, 21 Dec 2018 12:20:36 +0100 From: Christoph Hellwig To: Jens Axboe Cc: linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, hch@lst.de, viro@zeniv.linux.org.uk Subject: Re: [PATCH 02/22] block: add REQ_HIPRI_ASYNC Message-ID: <20181221112036.GA7319@lst.de> References: <20181218154230.3120-1-axboe@kernel.dk> <20181218154230.3120-3-axboe@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181218154230.3120-3-axboe@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Dec 18, 2018 at 08:42:10AM -0700, Jens Axboe wrote: > For the upcoming async polled IO, we can't sleep allocating requests. > If we do, then we introduce a deadlock where the submitter already > has async polled IO in-flight, but can't wait for them to complete > since polled requests must be active found and reaped. So two comments here. First I think after the next -rc1 we really need to rename REQ_HIPRI to REQ_POLLED. Unlike the iocb hipri flag which is an advice to treat this I/O as urgent REQ_POLLED is a hard charaterisation and having the hipri name is badly misnamed for that. Second I retract my suggestion to add this _ASYNC variant, as it seems to cause more confusion than it helps. I think instead we want a helper like this: static void bio_set_polled(struct bio *bio, struct kiocb *kiocb) { bio->bi_opf |= REQ_POLLED; if (!is_sync_kiocb(kiocb) bio->bi_opf |= REQ_NOWAIT; } maybe plus comments to better indicate the intentional and consolidate the is_sync check.