diff options
author | 2022-04-25 18:38:14 -0700 | |
---|---|---|
committer | 2022-04-28 10:25:42 -0700 | |
commit | b037c4eed2df4568a7702cd512d26625962f95b9 (patch) | |
tree | f486c5504d4793ef91e0aa6e7784584f53f8727e /fs/xfs/libxfs/xfs_log_rlimit.c | |
parent | xfs: reduce the absurdly large log operation count (diff) | |
download | linux-dev-b037c4eed2df4568a7702cd512d26625962f95b9.tar.xz linux-dev-b037c4eed2df4568a7702cd512d26625962f95b9.zip |
xfs: reduce transaction reservations with reflink
Before to the introduction of deferred refcount operations, reflink
would try to cram refcount btree updates into the same transaction as an
allocation or a free event. Mainline XFS has never actually done that,
but we never refactored the transaction reservations to reflect that we
now do all refcount updates in separate transactions. Fix this to
reduce the transaction reservation size even farther, so that between
this patch and the previous one, we reduce the tr_write and tr_itruncate
sizes by 66%.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_log_rlimit.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_log_rlimit.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_log_rlimit.c b/fs/xfs/libxfs/xfs_log_rlimit.c index 60fff8c6716f..9975b93a7412 100644 --- a/fs/xfs/libxfs/xfs_log_rlimit.c +++ b/fs/xfs/libxfs/xfs_log_rlimit.c @@ -80,6 +80,18 @@ xfs_log_calc_trans_resv_for_minlogblocks( resv->tr_qm_dqalloc.tr_logcount = XFS_WRITE_LOG_COUNT; } + /* + * In the early days of reflink, we did not use deferred refcount + * update log items, so log reservations must be recomputed using the + * old calculations. + */ + resv->tr_write.tr_logres = + xfs_calc_write_reservation_minlogsize(mp); + resv->tr_itruncate.tr_logres = + xfs_calc_itruncate_reservation_minlogsize(mp); + resv->tr_qm_dqalloc.tr_logres = + xfs_calc_qm_dqalloc_reservation_minlogsize(mp); + /* Put everything back the way it was. This goes at the end. */ mp->m_rmap_maxlevels = rmap_maxlevels; } |