From: Matthew Wilcox <willy@infradead.org>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v1] mm/readahead: Do not allow order-1 folio
Date: Fri, 1 Dec 2023 16:32:04 +0000 [thread overview]
Message-ID: <ZWoKhMpmXm31CURk@casper.infradead.org> (raw)
In-Reply-To: <20231201161045.3962614-1-ryan.roberts@arm.com>
On Fri, Dec 01, 2023 at 04:10:45PM +0000, Ryan Roberts wrote:
> The THP machinery does not support order-1 folios because it requires
> meta data spanning the first 3 `struct page`s. So order-2 is the
> smallest large folio that we can safely create.
>
> There was a theoretical bug whereby if ra->size was 2 or 3 pages (due to
> the device-specific bdi->ra_pages being set that way), we could end up
> with order = 1. Fix this by unconditionally checking if the preferred
> order is 1 and if so, set it to 0. Previously this was done in a few
> specific places, but with this refactoring it is done just once,
> unconditionally, at the end of the calculation.
>
> This is a theoretical bug found during review of the code; I have no
> evidence to suggest this manifests in the real world (I expect all
> device-specific ra_pages values are much bigger than 3).
>
> Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
It's better code anyway!
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
prev parent reply other threads:[~2023-12-01 16:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 16:10 Ryan Roberts
2023-12-01 16:32 ` Matthew Wilcox [this message]
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=ZWoKhMpmXm31CURk@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ryan.roberts@arm.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