[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZXhcaQh3UFZmyFmQ@infradead.org>
Date: Tue, 12 Dec 2023 05:13:13 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Hongyu Jin <hongyu.jin.cn@...il.com>
Cc: agk@...hat.com, snitzer@...nel.org, mpatocka@...hat.com,
axboe@...nel.dk, ebiggers@...nel.org, zhiguo.niu@...soc.com,
ke.wang@...soc.com, yibin.ding@...soc.com, hongyu.jin@...soc.com,
linux-kernel@...r.kernel.org, dm-devel@...ts.linux.dev,
linux-block@...r.kernel.org
Subject: Re: [PATCH v4 1/5] block: Fix bio IO priority setting
On Tue, Dec 12, 2023 at 07:11:46PM +0800, Hongyu Jin wrote:
> From: Hongyu Jin <hongyu.jin@...soc.com>
>
> Move bio_set_ioprio() into submit_bio():
> 1. Only call bio_set_ioprio() once to set the priority of original bio,
> the bio that cloned and splited from original bio will auto inherit
> the priority of original bio in clone process.
>
> 2. The IO priority can be passed to module that implement
> struct gendisk::fops::submit_bio, help resolve some
> of the IO priority loss issues.
Can we reword this a bit. AFAICS what this primarily does it to ensure
the priority is set before dispatching to submit_bio based drivers or
blk-mq instead of just blk-mq, and the rest follows from that.
> +static void bio_set_ioprio(struct bio *bio)
> +{
> + /* Nobody set ioprio so far? Initialize it based on task's nice value */
> + if (IOPRIO_PRIO_CLASS(bio->bi_ioprio) == IOPRIO_CLASS_NONE)
> + bio->bi_ioprio = get_current_ioprio();
> + blkcg_set_ioprio(bio);
> +}
I don't think we need the check here as anyone resubmitting a bio should
be using submit_bio_noact.
Powered by blists - more mailing lists