linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hsin-Yi Wang <hsinyi@chromium.org>
To: Matthew Wilcox <willy@infradead.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: Thu, 7 Oct 2021 12:08:57 +0800	[thread overview]
Message-ID: <CAJMQK-i0wL7SAo3C5r2Ty9SaJhZ7OyO+DJdq-E3i9LBW_vJ4Jw@mail.gmail.com> (raw)
In-Reply-To: <YV2gpWYhcJxiDArT@casper.infradead.org>

On Wed, Oct 6, 2021 at 9:12 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Wed, Oct 06, 2021 at 09:07:56PM +0800, Hsin-Yi Wang wrote:
> > On Wed, Oct 6, 2021 at 7:21 PM Matthew Wilcox <willy@infradead.org> wrote:
> > >
> > > 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?
> > >
> > ext4, block size 4096
>
> That's confusing.  ext4 shouldn't hit that path; it has a ->readahead
> address space operation.

Sorry for the confusion, both readahead and readpage are called.
The ->readpage is called by vfs: vfs_fadvise.
(Full path)
read_pages
page_cache_ra_unbounded
do_page_cache_ra
force_page_cache_ra
generic_fadvise
vfs_fadvise
ksys_readahead
__arm64_compat_sys_aarch32_readahead
el0_svc_common
do_el0_svc_compat
el0_svc_compat
el0_sync_compat_handler
el0_sync_compat

The ->readahead is called by ext4: ext4_file_read_iter. But this part is fast.
(Full path)
read_pages
page_cache_ra_unbounded
do_page_cache_ra
ondemand_readahead
page_cache_sync_ra
generic_file_buffered_read
generic_file_read_iter
ext4_file_read_iter
do_iter_readv_writev
do_iter_read
vfs_iter_read
loop_queue_work
kthread_worker_fn
loop_kthread_worker_fn
kthread
ret_from_fork


  reply	other threads:[~2021-10-07  4:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06  9:25 Hsin-Yi Wang
2021-10-06 11:20 ` Matthew Wilcox
2021-10-06 13:07   ` Hsin-Yi Wang
2021-10-06 13:12     ` Matthew Wilcox
2021-10-07  4:08       ` Hsin-Yi Wang [this message]
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=CAJMQK-i0wL7SAo3C5r2Ty9SaJhZ7OyO+DJdq-E3i9LBW_vJ4Jw@mail.gmail.com \
    --to=hsinyi@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linux-mm@kvack.org \
    --cc=william.kucharski@oracle.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