From: Matthew Wilcox <willy@infradead.org>
To: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Jens Axboe <axboe@kernel.dk>, Yu Zhao <yuzhao@google.com>,
Damien Le Moal <dlemoal@kernel.org>,
Niklas Cassel <niklas.cassel@wdc.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Hannes Reinecke <hare@suse.de>,
Linus Walleij <linus.walleij@linaro.org>,
linux-mm@kvack.org, linux-block@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Zhaoyang Huang <huangzhaoyang@gmail.com>,
steve.kang@unisoc.com
Subject: Re: [PATCHv4 1/1] block: introduce content activity based ioprio
Date: Fri, 26 Jan 2024 14:24:12 +0000 [thread overview]
Message-ID: <ZbPAjGJr7hrOvNOo@casper.infradead.org> (raw)
In-Reply-To: <20240126120800.3410349-1-zhaoyang.huang@unisoc.com>
On Fri, Jan 26, 2024 at 08:08:00PM +0800, zhaoyang.huang wrote:
> +#ifdef CONFIG_CONTENT_ACT_BASED_IOPRIO
> +#define bio_add_page(bio, page, len, offset) \
> + ({ \
> + int class, level, hint, activity; \
> + int ret = 0; \
> + ret = bio_add_page(bio, page, len, offset); \
> + if (ret > 0) { \
> + 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); \
> + activity += (bio->bi_vcnt + 1 <= IOPRIO_NR_ACTIVITY && \
> + PageWorkingset(&folio->page)) ? 1 : 0; \
I know you didn't even compile this version.
More importantly, conceptually it doesn't work. All kinds of pages
get added to bios, and not all of them are file/anon pages. That
PageWorkingset bit might well be reused for other purposes. Only
the caller knows if this is file/anon memory. You can't do this here.
next prev parent reply other threads:[~2024-01-26 14:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-26 12:08 zhaoyang.huang
2024-01-26 14:24 ` Matthew Wilcox [this message]
2024-01-30 8:37 ` Zhaoyang Huang
2024-01-26 18:51 ` Niklas Cassel
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=ZbPAjGJr7hrOvNOo@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=hare@suse.de \
--cc=huangzhaoyang@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=martin.petersen@oracle.com \
--cc=niklas.cassel@wdc.com \
--cc=steve.kang@unisoc.com \
--cc=yuzhao@google.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