From: Andrew Morton <akpm@linux-foundation.org>
To: Yuan-Hao Hsu <aa9736195201@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.cz>,
Jaegeuk Kim <jaegeuk@kernel.org>,
Pankaj Raghav <p.raghav@samsung.com>, Chao Yu <chao@kernel.org>,
Eric Biggers <ebiggers@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/readahead: use large folios in page_cache_ra_unbounded()
Date: Tue, 15 Sep 2026 17:26:15 -0700 [thread overview]
Message-ID: <20260915172615.c183c61c774f529ca57f1fb5@linux-foundation.org> (raw)
In-Reply-To: <20260915135909.1007-1-aa9736195201@gmail.com>
On Tue, 15 Sep 2026 21:59:09 +0800 Yuan-Hao Hsu <aa9736195201@gmail.com> wrote:
Thanks, and welcome to Linux (I think?).
> Forced readahead still allocates one folio per page. Everything that
> reaches page_cache_ra_unbounded() gets mapping_min_folio_order()
> folios, which is order 0 on ext4, xfs and btrfs:
Are any other filesystems affected by this change?
>
> ...
>
> Allocate the largest folio that fits instead
>
This all sounds great, but I worry that the resulting increased
consumption of larger-order pages will cause all sorts of unexpected
mayhem to all sorts of unexpected things.
: bounded by the mapping's
> maximum order, by what is left of the request and by the alignment of
> the index, never below the minimum order. Nothing beyond the request is
> read; for a forced read the request is exactly what the caller asked
> for. If an allocation fails, or filemap_add_folio() returns -ENOMEM,
> do not ask for that order again during this request. If
> filemap_add_folio() returns -EEXIST for a large folio, something sits
> within the range it would cover but the index itself may still be free,
> so retry with a smaller folio and only skip the index once the minimum
> size collides, as before. ra_alloc_folio() already does the
> allocation, the PG_readahead mark and the accounting for
> page_cache_ra_order(); move it up unchanged and use it here too, so
> the mark goes on the folio that contains the mark index in both
> places.
So for several reasons it's
- allocate a large folio
- check it
- oops, can't use it, free it and retry with a smaller one
People do all sorts of strange things and this alone could cause
meltdowns which we don't get to hear about for two years.
So the change seems quite logical but right now, I don't know how to
move ahead with it :(. What do others think?
next prev parent reply other threads:[~2026-09-16 0:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 13:59 Yuan-Hao Hsu
2026-09-16 0:26 ` Andrew Morton [this message]
2026-09-16 18:46 ` Yuan-Hao Hsu
2026-09-16 18:50 ` [PATCH v2] " Yuan-Hao Hsu
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=20260915172615.c183c61c774f529ca57f1fb5@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=aa9736195201@gmail.com \
--cc=chao@kernel.org \
--cc=ebiggers@kernel.org \
--cc=jack@suse.cz \
--cc=jaegeuk@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=p.raghav@samsung.com \
--cc=willy@infradead.org \
/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®