linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Zhaoyang Huang <huangzhaoyang@gmail.com>
Cc: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>,
	linux-fsdevel@vger.kernel.org,
	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-kernel@vger.kernel.org, steve.kang@unisoc.com
Subject: Re: [PATCHv3 1/1] block: introduce content activity based ioprio
Date: Fri, 26 Jan 2024 08:55:36 +0000	[thread overview]
Message-ID: <ZbNziLeet7TbDKEl@casper.infradead.org> (raw)
In-Reply-To: <CAGWkznGpW=bUxET8yZGu4dNTBfsj7n79yXsTD23fE5-SWkdjfA@mail.gmail.com>

On Fri, Jan 26, 2024 at 03:59:48PM +0800, Zhaoyang Huang wrote:
> loop more mm and fs guys for more comments

I agree with everything Damien said.  But also ...

> > +bool BIO_ADD_FOLIO(struct bio *bio, struct folio *folio, size_t len,
> > +               size_t off)

You don't add any users of these functions.  It's hard to assess whether
this is the right API when there are no example users.

> > +       activity += (bio->bi_vcnt + 1 <= IOPRIO_NR_ACTIVITY &&
> > +                       PageWorkingset(&folio->page)) ? 1 : 0;

folio_test_workingset().

> > +       return bio_add_page(bio, &folio->page, len, off) > 0;

bio_add_folio().

> > +int BIO_ADD_PAGE(struct bio *bio, struct page *page,
> > +               unsigned int len, unsigned int offset)
> > +{
> > +       int class, level, hint, activity;
> > +
> > +       if (bio_add_page(bio, page, len, offset) > 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 <= IOPRIO_NR_ACTIVITY && PageWorkingset(page)) ? 1 : 0;
> > +               bio->bi_ioprio = IOPRIO_PRIO_VALUE_ACTIVITY(class, level, hint, activity);
> > +       }

why are BIO_ADD_PAGE and BIO_ADD_FOLIO so very different from each
other?

> >  static __always_inline __u16 ioprio_value(int prioclass, int priolevel,
> > -                                         int priohint)
> > +               int priohint)

why did you change this whitespace?

> >  {
> >         if (IOPRIO_BAD_VALUE(prioclass, IOPRIO_NR_CLASSES) ||
> > -           IOPRIO_BAD_VALUE(priolevel, IOPRIO_NR_LEVELS) ||
> > -           IOPRIO_BAD_VALUE(priohint, IOPRIO_NR_HINTS))
> > +                       IOPRIO_BAD_VALUE(priolevel, IOPRIO_NR_LEVELS) ||
> > +                       IOPRIO_BAD_VALUE(priohint, IOPRIO_NR_HINTS))

ditto

> >                 return IOPRIO_CLASS_INVALID << IOPRIO_CLASS_SHIFT;
> >
> >         return (prioclass << IOPRIO_CLASS_SHIFT) |
> >                 (priohint << IOPRIO_HINT_SHIFT) | priolevel;
> >  }
> > -

more gratuitous whitespace change



  reply	other threads:[~2024-01-26  8:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25  7:19 zhaoyang.huang
2024-01-25  7:40 ` Damien Le Moal
2024-01-25  7:52   ` Zhaoyang Huang
2024-01-25  8:26     ` Damien Le Moal
2024-01-25  9:32       ` Zhaoyang Huang
2024-01-25  9:37         ` Zhaoyang Huang
2024-01-25  9:54           ` Damien Le Moal
2024-01-25 10:10             ` Zhaoyang Huang
2024-01-26  1:14               ` Zhaoyang Huang
2024-01-26  7:59 ` Zhaoyang Huang
2024-01-26  8:55   ` Matthew Wilcox [this message]
2024-01-26  9:28     ` Zhaoyang Huang
2024-01-26  9:36       ` Matthew Wilcox
2024-01-26  9:49         ` 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=ZbNziLeet7TbDKEl@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --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=viro@zeniv.linux.org.uk \
    --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