diff options
author | Ritesh Harjani (IBM) <ritesh.list@gmail.com> | 2023-07-10 14:12:43 -0700 |
---|---|---|
committer | Ritesh Harjani (IBM) <ritesh.list@gmail.com> | 2023-07-25 10:55:56 +0530 |
commit | 4ce02c67972211be488408c275c8fbf19faf29b3 (patch) | |
tree | 976b4a0fa2e9d6f6dd88a2a25567f5d52c5ff2ff /include/linux/iomap.h | |
parent | a01b8f225248e86f3328a48c3311882148a8c5d3 (diff) | |
download | linux-4ce02c67972211be488408c275c8fbf19faf29b3.tar.gz linux-4ce02c67972211be488408c275c8fbf19faf29b3.tar.bz2 linux-4ce02c67972211be488408c275c8fbf19faf29b3.zip |
iomap: Add per-block dirty state tracking to improve performance
When filesystem blocksize is less than folio size (either with
mapping_large_folio_support() or with blocksize < pagesize) and when the
folio is uptodate in pagecache, then even a byte write can cause
an entire folio to be written to disk during writeback. This happens
because we currently don't have a mechanism to track per-block dirty
state within struct iomap_folio_state. We currently only track uptodate
state.
This patch implements support for tracking per-block dirty state in
iomap_folio_state->state bitmap. This should help improve the filesystem
write performance and help reduce write amplification.
Performance testing of below fio workload reveals ~16x performance
improvement using nvme with XFS (4k blocksize) on Power (64K pagesize)
FIO reported write bw scores improved from around ~28 MBps to ~452 MBps.
1. <test_randwrite.fio>
[global]
ioengine=psync
rw=randwrite
overwrite=1
pre_read=1
direct=0
bs=4k
size=1G
dir=./
numjobs=8
fdatasync=1
runtime=60
iodepth=64
group_reporting=1
[fio-run]
2. Also our internal performance team reported that this patch improves
their database workload performance by around ~83% (with XFS on Power)
Reported-by: Aravinda Herle <araherle@in.ibm.com>
Reported-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'include/linux/iomap.h')
-rw-r--r-- | include/linux/iomap.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 80facb9c9e5b..fdc6e64f49d6 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -264,6 +264,7 @@ bool iomap_is_partially_uptodate(struct folio *, size_t from, size_t count); struct folio *iomap_get_folio(struct iomap_iter *iter, loff_t pos, size_t len); bool iomap_release_folio(struct folio *folio, gfp_t gfp_flags); void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t len); +bool iomap_dirty_folio(struct address_space *mapping, struct folio *folio); int iomap_file_unshare(struct inode *inode, loff_t pos, loff_t len, const struct iomap_ops *ops); int iomap_zero_range(struct inode *inode, loff_t pos, loff_t len, |