From: Matthew Wilcox <willy@infradead.org>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org,
Wang Yugui <wangyugui@e16-tech.com>,
Dave Chinner <david@fromorbit.com>,
Christoph Hellwig <hch@infradead.org>,
"Darrick J . Wong" <djwong@kernel.org>,
Kent Overstreet <kent.overstreet@linux.dev>
Subject: Re: [PATCH v4 0/9] Create large folios in iomap buffered write path
Date: Tue, 11 Jul 2023 00:53:04 +0100 [thread overview]
Message-ID: <ZKyZ4Ie6EEc79iIG@casper.infradead.org> (raw)
In-Reply-To: <ZKyMVRDhwYWvqyvv@bombadil.infradead.org>
On Mon, Jul 10, 2023 at 03:55:17PM -0700, Luis Chamberlain wrote:
> On Mon, Jul 10, 2023 at 02:02:44PM +0100, Matthew Wilcox (Oracle) wrote:
> > Commit ebb7fb1557b1 limited the length of ioend chains to 4096 entries
> > to improve worst-case latency. Unfortunately, this had the effect of
> > limiting the performance of:
> >
> > fio -name write-bandwidth -rw=write -bs=1024Ki -size=32Gi -runtime=30 \
> > -iodepth 1 -ioengine sync -zero_buffers=1 -direct=0 -end_fsync=1 \
> > -numjobs=4 -directory=/mnt/test
>
> When you say performance, do you mean overall throughput / IOPS /
> latency or all?
This is buffered I/O, so when we run out of RAM, we block until the
dirty pages are written back. I suppose that makes it throughput, but
it's throughput from the bottom of the page cache to storage, not the
usual app-to-page-cache bottleneck.
> And who noticed it / reported it? The above incantation seems pretty
> specific so I'm curious who runs that test and what sort of work flow
> is it trying to replicate.
Wang Yugui, who is on the cc reported it.
https://lore.kernel.org/linux-xfs/20230508172406.1CF3.409509F4@e16-tech.com/
> > The problem ends up being lock contention on the i_pages spinlock as we
> > clear the writeback bit on each folio (and propagate that up through
> > the tree). By using larger folios, we decrease the number of folios
> > to be processed by a factor of 256 for this benchmark, eliminating the
> > lock contention.
>
> Implied here seems to suggest that the associated cost for the search a
> larger folio is pretty negligable compared the gains of finding one.
> That seems to be nice but it gets me wondering if there are other
> benchmarks under which there is any penalties instead.
>
> Ie, is the above a microbenchmark where this yields good results?
It happens to be constructed in such a way that it yields the optimum
outcome in this case, but that clearly wasn't deliberate. And the
solution is the one I had in mind from before the bug report came in.
I don't think you'll be able to find a benchmark that regresses as
a result of this, but I welcome your attempt!
> > It's also the right thing to do. This is a project that has been on
> > the back burner for years, it just hasn't been important enough to do
> > before now.
>
> Commit ebb7fb1557b1 (xfs, iomap: limit individual ioend chain lengths in
> writeback") dates back to just one year, and so it gets me wondering
> how a project in the back burner for years now finds motivation for
> just a one year old regression.
>
> What was the original motivation of the older project dating this
> effort back to its inception?
We should create larger folios on write. It just wasn't important
enough to do before now. But now there's an actual user who cares.
next prev parent reply other threads:[~2023-07-10 23:53 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 13:02 [PATCH v4 0/9] Create large folios in iomap buffered write path Matthew Wilcox (Oracle)
2023-07-10 13:02 ` [PATCH v4 1/9] iov_iter: Handle compound highmem pages in copy_page_from_iter_atomic() Matthew Wilcox (Oracle)
2023-07-10 23:43 ` Luis Chamberlain
2023-07-11 0:03 ` Matthew Wilcox
2023-07-11 6:30 ` Christoph Hellwig
2023-07-11 20:05 ` Kent Overstreet
2023-07-13 4:42 ` Darrick J. Wong
2023-07-13 13:46 ` Matthew Wilcox
2023-07-10 13:02 ` [PATCH v4 2/9] iov_iter: Add copy_folio_from_iter_atomic() Matthew Wilcox (Oracle)
2023-07-11 6:31 ` Christoph Hellwig
2023-07-11 20:46 ` Matthew Wilcox
2023-07-24 15:56 ` Darrick J. Wong
2023-07-10 13:02 ` [PATCH v4 3/9] iomap: Remove large folio handling in iomap_invalidate_folio() Matthew Wilcox (Oracle)
2023-07-10 13:02 ` [PATCH v4 4/9] doc: Correct the description of ->release_folio Matthew Wilcox (Oracle)
2023-07-13 4:43 ` Darrick J. Wong
2023-07-10 13:02 ` [PATCH v4 5/9] iomap: Remove unnecessary test from iomap_release_folio() Matthew Wilcox (Oracle)
2023-07-13 4:45 ` Darrick J. Wong
2023-07-13 5:25 ` Ritesh Harjani
2023-07-13 5:33 ` Darrick J. Wong
2023-07-13 5:51 ` Ritesh Harjani
2023-07-10 13:02 ` [PATCH v4 6/9] filemap: Add fgf_t typedef Matthew Wilcox (Oracle)
2023-07-13 4:47 ` Darrick J. Wong
2023-07-13 5:08 ` Kent Overstreet
2023-07-10 13:02 ` [PATCH v4 7/9] filemap: Allow __filemap_get_folio to allocate large folios Matthew Wilcox (Oracle)
2023-07-10 23:58 ` Luis Chamberlain
2023-07-11 0:07 ` Matthew Wilcox
2023-07-11 0:21 ` Luis Chamberlain
2023-07-11 0:42 ` Matthew Wilcox
2023-07-11 0:47 ` Dave Chinner
2023-07-11 0:13 ` Kent Overstreet
2023-07-13 4:50 ` Darrick J. Wong
2023-07-13 5:04 ` Kent Overstreet
2023-07-13 14:42 ` Matthew Wilcox
2023-07-13 15:19 ` Kent Overstreet
2023-07-10 13:02 ` [PATCH v4 8/9] iomap: Create large folios in the buffered write path Matthew Wilcox (Oracle)
2023-07-13 4:56 ` Darrick J. Wong
2023-07-10 13:02 ` [PATCH v4 9/9] iomap: Copy larger chunks from userspace Matthew Wilcox (Oracle)
2023-07-13 4:58 ` Darrick J. Wong
2023-07-10 22:55 ` [PATCH v4 0/9] Create large folios in iomap buffered write path Luis Chamberlain
2023-07-10 23:53 ` Matthew Wilcox [this message]
2023-07-11 0:01 ` Dave Chinner
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=ZKyZ4Ie6EEc79iIG@casper.infradead.org \
--to=willy@infradead.org \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=kent.overstreet@linux.dev \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=wangyugui@e16-tech.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).