linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zhaoyang Huang <huangzhaoyang@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>,
	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,
	steve.kang@unisoc.com
Subject: Re: [PATCHv6 1/1] block: introduce content activity based ioprio
Date: Thu, 1 Feb 2024 12:05:23 +0800	[thread overview]
Message-ID: <CAGWkznEv=A1AOe=xGWvNnaUq2eAfrHy2TQFyScNyu9rqQ+Q6xA@mail.gmail.com> (raw)
In-Reply-To: <CAGWkznGLt-T1S7_BM8-2eLhxVYktYYLmdfMbRKRK88Ami-mEdg@mail.gmail.com>

On Thu, Feb 1, 2024 at 10:39 AM Zhaoyang Huang <huangzhaoyang@gmail.com> wrote:
>
> On Wed, Jan 31, 2024 at 9:23 PM Matthew Wilcox <willy@infradead.org> wrote:
> >
> > On Wed, Jan 31, 2024 at 06:59:12PM +0800, zhaoyang.huang wrote:
> > > change of v6: replace the macro of bio_add_xxx by submit_bio which
> > >               iterating the bio_vec before launching bio to block layer
> >
> > Still wrong.
> I did some research on bio operations in the system and state my
> understanding here. I would like to have you review it and give me
> more details of the fault. thanks
>
> 1. REQ_OP_ZONE_xxx
> a. These operations are from driver/block layer/fs where we can keep
> driver/block layer using the legacy submit_bio by not including
> act_prio.h.
> b. most of fs's REQ_OP_ZONE_xxx will be handled by blkdev_zone_mgmt
> which is the same as 'a'
> c. __submit_zone_reset_cmd within f2fs use no page for REQ_OP_ZONE_RESET
>
> 2. other REQ_OP_<none>_READ/WRITE except REQ_OP_ZONE_xxx
> These operations all comes from driver and block layer as same as 1.a
>
> 3. direct_io
> keep fs/direct-io.c and fs/iomap/direct-io.c using legacy submit_bio
>
> 4. metadata, dentry
> Are these data also file pages?
>
> 5. normal REQ_OP_READ/WRITE/SYNC
> fs choose to use act based submit_bio by including act_ioprio.h in
> corresponding c file

OR could I restrict the change by judging bio_op as below

+ if (bio_op(bio) == REQ_OP_READ || bio_op(bio) == REQ_OP_WRITE)
+ {
       class = IOPRIO_PRIO_CLASS(bio->bi_ioprio);
       level = IOPRIO_PRIO_LEVEL(bio->bi_ioprio);
       hint = IOPRIO_PRIO_HINT(bio->bi_ioprio);
       bio_for_each_bvec(bv, bio, iter) {
               page = bv.bv_page;
               activity += PageWorkingset(page) ? 1 : 0;
               cnt++;
       }
       if (activity >= cnt / 2)
               class = IOPRIO_CLASS_RT;
       else if (activity >= cnt / 4)
               class = max(IOPRIO_PRIO_CLASS(get_current_ioprio()),
IOPRIO_CLASS_BE);
       bio->bi_ioprio = IOPRIO_PRIO_VALUE_HINT(class, level, hint);
+ }
       submit_bio(bio);


  reply	other threads:[~2024-02-01  4:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 10:59 zhaoyang.huang
2024-01-31 13:22 ` Matthew Wilcox
2024-02-01  2:39   ` Zhaoyang Huang
2024-02-01  4:05     ` Zhaoyang Huang [this message]
2024-02-01  4:37       ` Matthew Wilcox

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='CAGWkznEv=A1AOe=xGWvNnaUq2eAfrHy2TQFyScNyu9rqQ+Q6xA@mail.gmail.com' \
    --to=huangzhaoyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=hare@suse.de \
    --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=willy@infradead.org \
    --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