From: Andrew Morton <akpm@linux-foundation.org>
To: daejun7.park@samsung.com
Cc: Daejun Park via B4 Relay
<devnull+daejun7.park.samsung.com@kernel.org>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
Jan Kara <jack@suse.cz>, Ryan Roberts <ryan.roberts@arm.com>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/readahead: keep at least half of the async window when aligning it
Date: Mon, 2 Nov 2026 11:15:54 -0800 [thread overview]
Message-ID: <20261102111554.535bd2c6d0520877ea3342bb@linux-foundation.org> (raw)
In-Reply-To: <20261030-mm-readahead-async-align-v1-1-109dea6851fc@samsung.com>
On Fri, 30 Oct 2026 12:52:57 +0900 Daejun Park via B4 Relay <devnull+daejun7.park.samsung.com@kernel.org> wrote:
> From: Daejun Park <daejun7.park@samsung.com>
>
> page_cache_async_ra() trims the end of each new window to a multiple of
> 1 << ra->order pages. A window that starts just below such a boundary
> keeps only a few pages. With read_ahead_kb=128 and max_sectors_kb=512,
> 1 MiB reads after a 4 KiB read at offset 0 hit this on about one window
> in three. They issue three times as many device reads.
>
> Halve the alignment until the trim keeps at least half of the window.
>
Thanks, but...
> ---
> Tested on mm-new in a QEMU guest with XFS on an emulated NVMe,
> read_ahead_kb 128 and a cold cache.
>
> - max_sectors_kb 512, median of 5 runs: reading a 512 MiB file this
> way takes 0.247 s before and 0.180 s after. The device sees 3329 and
> 1032 reads.
>
> - Other reads with max_sectors_kb 512: without the 4 KiB read, and with
> 64 KiB reads, the times do not change. Random 4 KiB and 64 KiB reads,
> two interleaved streams on one file, and 2 MiB reads at random
> offsets also take the same time. They read the same amount from the
> device, within 0.3%.
>
> With the device's transfer limit at 2 MiB:
>
> - max_sectors_kb 256: 512 KiB reads after the 4 KiB read take 0.626 s
> before and 0.322 s after. The device sees 6147 and 2056 reads.
>
> - max_sectors_kb 1024 or 2048: 1 MiB reads are not trimmed.
>
> - max_sectors_kb 2048, 3 MiB reads: the device sees 343 instead of 271
> reads. The time is 0.120 s instead of 0.118 s, the median of 40 runs.
> The interquartile range is about 0.10 to 0.13 s for both. The window
> stays at 3/4 of the maximum, off the 2 MiB boundary. mm-new reaches
> that boundary by trimming deeply.
The whole objective of the patch is "speed things up". So a description
of how much the patch sped things up is essential changelog material!
IOW, please summarize it heavily and include the performance testing
results in the actual changelog. Low-level testing details can be
retained below the ---.
next prev parent reply other threads:[~2026-11-02 19:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 3:52 Daejun Park via B4 Relay
2026-11-02 19:15 ` Andrew Morton [this message]
2026-11-02 21:46 ` Jan Kara
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=20261102111554.535bd2c6d0520877ea3342bb@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=daejun7.park@samsung.com \
--cc=devnull+daejun7.park.samsung.com@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ryan.roberts@arm.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®