[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZcCJbtX3xwBRCqYJ@casper.infradead.org>
Date: Mon, 5 Feb 2024 07:08:30 +0000
From: Matthew Wilcox <willy@...radead.org>
To: "zhaoyang.huang" <zhaoyang.huang@...soc.com>
Cc: Jens Axboe <axboe@...nel.dk>, Yu Zhao <yuzhao@...gle.com>,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
Zhaoyang Huang <huangzhaoyang@...il.com>, steve.kang@...soc.com
Subject: Re: [PATCHv7 1/1] block: introduce content activity based ioprio
On Mon, Feb 05, 2024 at 01:57:05PM +0800, zhaoyang.huang wrote:
> +/*
> + * bio_set_active_ioprio() is helper function for fs to adjust the bio's ioprio via
> + * calculating the content's activity which measured from MGLRU.
> + * The file system should call this function before submit_bio for the buffered
> + * read/write/sync.
> + */
> +#ifdef CONFIG_BLK_CONT_ACT_BASED_IOPRIO
> +void bio_set_active_ioprio(struct bio *bio)
> +{
> + struct bio_vec bv;
> + struct bvec_iter iter;
> + struct page *page;
> + int class, level, hint;
> + int activity = 0;
> + int cnt = 0;
> +
> + class = IOPRIO_PRIO_CLASS(bio->bi_ioprio);
> + level = IOPRIO_PRIO_LEVEL(bio->bi_ioprio);
> + hint = IOPRIO_PRIO_HINT(bio->bi_ioprio);
> + /*apply legacy ioprio policy on RT task*/
> + if (task_is_realtime(current)) {
> + bio->bi_ioprio = IOPRIO_PRIO_VALUE_HINT(IOPRIO_CLASS_RT, level, hint);
> + return;
> + }
> + bio_for_each_bvec(bv, bio, iter) {
> + page = bv.bv_page;
I gave you the prototype:
: No, stop this. What the filesystem needs to do is not
: s/bio_add_folio/act_bio_add_folio/. There needs to be an API to set the
: bio prio; something like:
:
: bio_set_active_prio(bio, folio);
Do not iterate over the bio. Use the folio provided to set the prio.
Or is there some reason this doesn't work?
Powered by blists - more mailing lists