diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-07-24 16:12:29 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2023-07-24 16:12:29 -0700 |
commit | d42bd17c6a20638ddf96862bfc0c47e481c28392 (patch) | |
tree | 97191965a56afcb9f875fcc8dfd44a1bec80136f /fs/btrfs/file.c | |
parent | 6eaae198076080886b9e7d57f4ae06fa782f90ef (diff) | |
parent | 5d8edfb900d55db7dbf2dbf325bfb9fdb863ec72 (diff) |
Merge tag 'large-folio-writes' of git://git.infradead.org/users/willy/pagecache into iomap-6.6-merge
Create large folios in iomap buffered write path
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
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.
Creating large folios in the buffered write path is also the right
thing to do. It's a project that has been on the back burner for years,
it just hasn't been important enough to do before now.
* tag 'large-folio-writes' of git://git.infradead.org/users/willy/pagecache:
iomap: Copy larger chunks from userspace
iomap: Create large folios in the buffered write path
filemap: Allow __filemap_get_folio to allocate large folios
filemap: Add fgf_t typedef
iomap: Remove unnecessary test from iomap_release_folio()
doc: Correct the description of ->release_folio
iomap: Remove large folio handling in iomap_invalidate_folio()
iov_iter: Add copy_folio_from_iter_atomic()
iov_iter: Handle compound highmem pages in copy_page_from_iter_atomic()
iov_iter: Map the page later in copy_page_from_iter_atomic()
[djwong: yay amortizations!]
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index fd03e689a6be..3876fae90fc3 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -876,9 +876,9 @@ static int prepare_uptodate_page(struct inode *inode, return 0; } -static unsigned int get_prepare_fgp_flags(bool nowait) +static fgf_t get_prepare_fgp_flags(bool nowait) { - unsigned int fgp_flags = FGP_LOCK | FGP_ACCESSED | FGP_CREAT; + fgf_t fgp_flags = FGP_LOCK | FGP_ACCESSED | FGP_CREAT; if (nowait) fgp_flags |= FGP_NOWAIT; @@ -910,7 +910,7 @@ static noinline int prepare_pages(struct inode *inode, struct page **pages, int i; unsigned long index = pos >> PAGE_SHIFT; gfp_t mask = get_prepare_gfp_flags(inode, nowait); - unsigned int fgp_flags = get_prepare_fgp_flags(nowait); + fgf_t fgp_flags = get_prepare_fgp_flags(nowait); int err = 0; int faili; |