From: Christoph Hellwig <hch@infradead.org>
To: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Zhaoyang Huang <huangzhaoyang@gmail.com>,
steve.kang@unisoc.com
Subject: Re: [PATCHv2 1/1] block: introduce content activity based ioprio
Date: Wed, 24 Jan 2024 01:20:09 -0800 [thread overview]
Message-ID: <ZbDWSUkT/OjHTe0t@infradead.org> (raw)
In-Reply-To: <20240124085334.3060748-1-zhaoyang.huang@unisoc.com>
On Wed, Jan 24, 2024 at 04:53:34PM +0800, zhaoyang.huang wrote:
> void __bio_add_page(struct bio *bio, struct page *page,
> unsigned int len, unsigned int off)
> {
> + int class, level, hint, activity;
> +
> + class = IOPRIO_PRIO_CLASS(bio->bi_ioprio);
> + level = IOPRIO_PRIO_LEVEL(bio->bi_ioprio);
> + hint = IOPRIO_PRIO_HINT(bio->bi_ioprio);
> + activity = IOPRIO_PRIO_ACTIVITY(bio->bi_ioprio);
> +
> WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED));
> WARN_ON_ONCE(bio_full(bio, len));
>
> bvec_set_page(&bio->bi_io_vec[bio->bi_vcnt], page, len, off);
> bio->bi_iter.bi_size += len;
> bio->bi_vcnt++;
> + activity += bio_page_if_active(bio, page, IOPRIO_NR_ACTIVITY);
> + bio->bi_ioprio = IOPRIO_PRIO_VALUE_ACTIVITY(class, level, hint, activity);
If you need to touch anything in the block layer I/O path
you're doign this wrong. The file system that is submitting the
I/O needs to be in control of the priorities.
must not hack the assignment behind the
next prev parent reply other threads:[~2024-01-24 9:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-24 8:53 zhaoyang.huang
2024-01-24 9:20 ` Christoph Hellwig [this message]
2024-01-24 9:35 ` Zhaoyang Huang
2024-01-24 9:38 ` Christoph Hellwig
2024-01-24 11:58 ` Zhaoyang Huang
2024-01-24 15:38 ` Jens Axboe
2024-01-25 7:29 ` Zhaoyang Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZbDWSUkT/OjHTe0t@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=huangzhaoyang@gmail.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=steve.kang@unisoc.com \
--cc=zhaoyang.huang@unisoc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®