linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Readahead regressed with c1f6925e1091("mm: put readahead pages in cache earlier") on multicore arm64 platforms
@ 2021-10-06  9:25 Hsin-Yi Wang
  2021-10-06 11:20 ` Matthew Wilcox
  0 siblings, 1 reply; 8+ messages in thread
From: Hsin-Yi Wang @ 2021-10-06  9:25 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, William Kucharski, Christoph Hellwig, linux-mm

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())

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-10-08  4:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).