From: Matthew Wilcox <willy@infradead.org>
To: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
William Kucharski <william.kucharski@oracle.com>,
Christoph Hellwig <hch@lst.de>,
linux-mm@kvack.org
Subject: Re: Readahead regressed with c1f6925e1091("mm: put readahead pages in cache earlier") on multicore arm64 platforms
Date: Wed, 6 Oct 2021 12:20:54 +0100 [thread overview]
Message-ID: <YV2GlrdkRMHGAPOE@casper.infradead.org> (raw)
In-Reply-To: <CAJMQK-g9G6KQmH-V=BRGX0swZji9Wxe_2c7ht-MMAapdFy2pXw@mail.gmail.com>
On Wed, Oct 06, 2021 at 05:25:23PM +0800, Hsin-Yi Wang wrote:
> Hi Matthew,
>
> We tested that the performance of readahead is regressed on multicore
> arm64 platforms running on the 5.10 kernel.
> - The platform we used: 8 cores (4x a53(small), 4x a73(big)) arm64 platform
> - The command we used: ureadahead $FILE ($FILE is a 1MB+ pack file,
> note that if the file size is small, it's not obvious to see the
> regression)
>
> After we revert the commit c1f6925e1091("mm: put readahead pages in
> cache earlier"), the readahead performance is back:
> - time ureadahead $FILE:
> - 5.10: 1m23.124s
> - with c1f6925e1091 reverted: 0m3.323s
> - other LTS kernel (eg. 5.4): 0m3.066s
>
> The slowest part is aops->readpage() in read_pages() called in
> read_pages(ractl, &page_pool, false); (the 3rd in
> page_cache_ra_unbounded())
What filesystem are you using?
> static void read_pages(struct readahead_control *rac, struct list_head *pages,
> bool skip_page)
> {
> ...
> if (aops->readahead) {
> ...
> } else if (aops->readpages) {
> ...
> } else {
> while ((page = readahead_page(rac))) {
> aops->readpage(rac->file, page); // most of the time is
> spent on this line
> put_page(page);
> }
> }
> ...
> }
>
> We also found following metrics that are relevant:
> - time ureadahead $FILE:
> - 5.10
> - taskset ureadahead to a small core: 0m7.411s
> - taskset ureadahead to a big core: 0m5.982s
> compared to the original 1m23s, pining the ureadahead task on a
> single core also solves the gap.
>
> Do you have any idea why moving pages to cache earlier then doing page
> read later will cause such a difference?
>
> Thanks,
>
> Hsin-Yi
next prev parent reply other threads:[~2021-10-06 11:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-06 9:25 Readahead regressed with c1f6925e1091("mm: put readahead pages in cache earlier") on multicore arm64 platforms Hsin-Yi Wang
2021-10-06 11:20 ` Matthew Wilcox [this message]
2021-10-06 13:07 ` Hsin-Yi Wang
2021-10-06 13:12 ` Matthew Wilcox
2021-10-07 4:08 ` Hsin-Yi Wang
2021-10-07 7:08 ` Hsin-Yi Wang
2021-10-07 13:45 ` Matthew Wilcox
2021-10-08 4:11 ` Hsin-Yi Wang
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=YV2GlrdkRMHGAPOE@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=hch@lst.de \
--cc=hsinyi@chromium.org \
--cc=linux-mm@kvack.org \
--cc=william.kucharski@oracle.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 NNTP newsgroup(s).