From: Jan Kara <jack@suse.cz>
To: "Yin, Fengwei" <fengwei.yin@intel.com>
Cc: Yujie Liu <yujie.liu@intel.com>, Jan Kara <jack@suse.cz>,
Oliver Sang <oliver.sang@intel.com>,
oe-lkp@lists.linux.dev, lkp@intel.com,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Matthew Wilcox <willy@infradead.org>,
Guo Xuenan <guoxuenan@huawei.com>,
linux-fsdevel@vger.kernel.org, ying.huang@intel.com,
feng.tang@intel.com
Subject: Re: [linus:master] [readahead] ab4443fe3c: vm-scalability.throughput -21.4% regression
Date: Thu, 7 Mar 2024 10:23:08 +0100 [thread overview]
Message-ID: <20240307092308.u54fjngivmx23ty3@quack3> (raw)
In-Reply-To: <dee823ca-7100-4289-8670-95047463c09d@intel.com>
On Mon 04-03-24 13:35:10, Yin, Fengwei wrote:
> Hi Jan,
>
> On 3/4/2024 12:59 PM, Yujie Liu wrote:
> > From the perf profile, we can see that the contention of folio lru lock
> > becomes more intense. We also did a simple one-file "dd" test. Looks
> > like it is more likely that low-order folios are allocated after commit
> > ab4443fe3c (Fengwei will help provide the data soon). Therefore, the
> > average folio size decreases while the total folio amount increases,
> > which leads to touching lru lock more often.
>
> I did following testing:
> With a xfs image in tmpfs + mount it to /mnt and create 12G test file
> (sparse-file), use one process to read it on a Ice Lake machine with
> 256G system memory. So we could make sure we are doing a sequential
> file read with no page reclaim triggered.
>
> At the same time, profiling the distribution of order parameter of
> filemap_alloc_folio() call to understand how the large folio order
> for page cache is generated.
>
> Here is what we got:
>
> - Commit f0b7a0d1d46625db:
> $ dd bs=4k if=/mnt/sparse-file of=/dev/null
> 3145728+0 records in
> 3145728+0 records out
> 12884901888 bytes (13 GB, 12 GiB) copied, 2.52208 s, 5.01 GB/s
>
> filemap_alloc_folio
> page order : count distribution
> 0 : 57 | |
> 1 : 0 | |
> 2 : 20 | |
> 3 : 2 | |
> 4 : 4 | |
> 5 : 98300 |****************************************|
>
> - Commit ab4443fe3ca6:
> $ dd bs=4k if=/mnt/sparse-file of=/dev/null
> 3145728+0 records in
> 3145728+0 records out
> 12884901888 bytes (13 GB, 12 GiB) copied, 2.51469 s, 5.1 GB/s
>
> filemap_alloc_folio
> page order : count distribution
> 0 : 21 | |
> 1 : 0 | |
> 2 : 196615 |****************************************|
> 3 : 98303 |******************* |
> 4 : 98303 |******************* |
>
>
> Even the file read throughput is almost same. But the distribution of
> order looks like a regression with ab4443fe3ca6 (more smaller order
> page cache is generated than parent commit). Thanks.
Thanks for testing! This is an interesting result and certainly unexpected
for me. The readahead code allocates naturally aligned pages so based on
the distribution of allocations it seems that before commit ab4443fe3ca6
readahead window was at least 32 pages (128KB) aligned and so we allocated
order 5 pages. After the commit, the readahead window somehow ended up only
aligned to 20 modulo 32. To follow natural alignment and fill 128KB
readahead window we allocated order 2 page (got us to offset 24 modulo 32),
then order 3 page (got us to offset 0 modulo 32), order 4 page (larger
would not fit in 128KB readahead window now), and order 2 page to finish
filling the readahead window.
Now I'm not 100% sure why the readahead window alignment changed with
different rounding when placing readahead mark - probably that's some
artifact when readahead window is tiny in the beginning before we scale it
up (I'll verify by tracing whether everything ends up looking correctly
with the current code). So I don't expect this is a problem in ab4443fe3ca6
as such but it exposes the issue that readahead page insertion code should
perhaps strive to achieve better readahead window alignment with logical
file offset even at the cost of occasionally performing somewhat shorter
readahead. I'll look into this once I dig out of the huge heap of email
after vacation...
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2024-03-07 9:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 8:25 kernel test robot
2024-02-21 11:14 ` Jan Kara
2024-02-22 1:32 ` Oliver Sang
2024-02-22 11:50 ` Jan Kara
2024-02-22 18:37 ` Jan Kara
2024-03-04 4:59 ` Yujie Liu
2024-03-04 5:35 ` Yin, Fengwei
2024-03-06 5:36 ` Yin Fengwei
2024-03-07 9:23 ` Jan Kara [this message]
2024-03-07 18:19 ` Matthew Wilcox
2024-03-08 8:37 ` Yujie Liu
2024-03-10 6:41 ` Yin, Fengwei
2024-03-10 6:40 ` Yin, Fengwei
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=20240307092308.u54fjngivmx23ty3@quack3 \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=feng.tang@intel.com \
--cc=fengwei.yin@intel.com \
--cc=guoxuenan@huawei.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-lkp@lists.linux.dev \
--cc=oliver.sang@intel.com \
--cc=willy@infradead.org \
--cc=ying.huang@intel.com \
--cc=yujie.liu@intel.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
all inboxes | Powered by JetHome®