Linux-mm Archive mirror
 help / color / mirror / Atom feed
From: Zhaoyang Huang <huangzhaoyang@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	"zhaoyang.huang" <zhaoyang.huang@unisoc.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Jens Axboe <axboe@kernel.dk>, Tejun Heo <tj@kernel.org>,
	 Josef Bacik <josef@toxicpanda.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	linux-mm@kvack.org,  linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org,  cgroups@vger.kernel.org,
	steve.kang@unisoc.com
Subject: Re: [RFC PATCH 2/2] mm: introduce budgt control in readahead
Date: Fri, 10 May 2024 15:08:16 +0800	[thread overview]
Message-ID: <CAGWkznFa9zQy5XzYeinG-xFEGKUPcxLL6bRNQaGa9Wo-tM0vWg@mail.gmail.com> (raw)
In-Reply-To: <Zj2fEo_YiW7NeDT8@casper.infradead.org>

On Fri, May 10, 2024 at 12:14 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Fri, May 10, 2024 at 11:06:14AM +0800, Zhaoyang Huang wrote:
> > On Thu, May 9, 2024 at 8:40 PM Christoph Hellwig <hch@infradead.org> wrote:
> > >
> > > > +     unsigned long budgt = inode->i_sb->s_bdev ?
> > > > +                     blk_throttle_budgt(inode->i_sb->s_bdev) : 0;
> > >
> > > The readahead code is used for all file systems, you can't just call
> > > into block layer code here.
> > >
> > ok. I would like to know any suggestions on introducing throttle
> > budget control into readahead which actually works as a negative
> > feedback path. IMO, negative feedback is a good methodology which has
> > been used in scheduler(EAS) and thermal control(IPA) and
> > memory(MGLRU). I would like to suggest to have a try on have it work
> > cross the boundary of memory and block layer.
> >
> > vfs_read / page fault
> > |
> > readahead  <---------|
> > |                               |
> > aops->readpages    |
> > |                               |
> > block_layer------------
>
> what you could do is have blk-throttle fail bios that are tagged as
> readahead if we've hit the threshold?
Actually, blk throttle will postpone the over-size bio's launch by
adding it to the throttle group's private queue which this idea aims
at. The delay here could be avoidable by some means to have the bio
meet the max ability of the throttle blkcg. Furthermore, we may get a
totally non over-sized readahead mechanism if we do this well.


  reply	other threads:[~2024-05-10  7:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09  2:39 [RFC PATCH 0/2] introduce budgt control in readahead zhaoyang.huang
2024-05-09  2:39 ` [RFC PATCH 1/2] block: introduce helper function to calculate bps budgt zhaoyang.huang
2024-05-09  2:39 ` [RFC PATCH 2/2] mm: introduce budgt control in readahead zhaoyang.huang
2024-05-09  3:15   ` Matthew Wilcox
2024-05-10  2:43     ` Zhaoyang Huang
2024-05-10  3:18       ` Matthew Wilcox
2024-05-11  7:35         ` Zhaoyang Huang
2024-05-14  2:37           ` Zhaoyang Huang
2024-05-09 12:39   ` Christoph Hellwig
2024-05-10  3:06     ` Zhaoyang Huang
2024-05-10  4:14       ` Matthew Wilcox
2024-05-10  7:08         ` Zhaoyang Huang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-05-15  1:23 [RFC PATCH 0/2] introduce precised blk-throttle control zhaoyang.huang
2024-05-15  1:23 ` [RFC PATCH 2/2] mm: introduce budgt control in readahead zhaoyang.huang
2024-05-15  4:09   ` Matthew Wilcox
2024-05-15  6:31     ` Zhaoyang Huang
2024-05-15  7:40   ` Tejun Heo
2024-05-15  8:17     ` 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=CAGWkznFa9zQy5XzYeinG-xFEGKUPcxLL6bRNQaGa9Wo-tM0vWg@mail.gmail.com \
    --to=huangzhaoyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hch@infradead.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=steve.kang@unisoc.com \
    --cc=tj@kernel.org \
    --cc=willy@infradead.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).