From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:40040 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726784AbeKSSmx (ORCPT ); Mon, 19 Nov 2018 13:42:53 -0500 Date: Mon, 19 Nov 2018 00:19:59 -0800 From: Christoph Hellwig To: Damien Le Moal Cc: linux-block@vger.kernel.org, Jens Axboe , Adam Manzanares , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 7/7] block: Initialize BIO I/O priority early Message-ID: <20181119081959.GR9622@infradead.org> References: <20181119035131.11255-1-damien.lemoal@wdc.com> <20181119035131.11255-8-damien.lemoal@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181119035131.11255-8-damien.lemoal@wdc.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Nov 19, 2018 at 12:51:31PM +0900, Damien Le Moal wrote: > For the synchronous I/O path case (read(), write() etc system calls), a > BIO I/O priority is not initialized until the execution of > blk_init_request_from_bio() when the BIO is submitted and a request > initialized for the BIO execution. This is due to the ki_ioprio field of > the struct kiocb defined on stack being always initialized to > IOPRIO_CLASS_NONE, regardless of the calling process I/O context ioprio > value set with ioprio_set(). This late initialization can result in the > BIO being merged to pending requests even when the I/O priorities > differ. > > Fix this by initializing the ki_iopriority field of on stack struct > kiocb using the get_current_ioprio() helper, ensuring that all BIOs > allocated and submitted for the system call execution see the correct > intended I/O priority early. With this, since a BIO I/O priority is > always set to the intended effective value for both the sync and async > path, blk_init_request_from_bio() can be simplified. > > Signed-off-by: Damien Le Moal Looks good, Reviewed-by: Christoph Hellwig