xfs: drop extra transaction roll from inode extent truncate

The inode extent truncate path unmaps extents from the inode block
mapping, finishes deferred ops to free the associated extents and
then explicitly rolls the transaction before processing the next
extent. The latter extent roll is spurious as xfs_defer_finish()
always returns a clean transaction and automatically relogs inodes
attached to the transaction (with lock_flags == 0). This can
unnecessarily increase the number of log ticket regrants that occur
during a long running truncate operation. Remove the explicit
transaction roll.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
Brian Foster 2020-09-15 20:44:46 -07:00 коммит произвёл Darrick J. Wong
Родитель b96cb835e3
Коммит 6dd379c7fa
1 изменённых файлов: 1 добавлений и 8 удалений

Просмотреть файл

@ -1534,17 +1534,10 @@ xfs_itruncate_extents_flags(
if (error)
goto out;
/*
* Duplicate the transaction that has the permanent
* reservation and commit the old transaction.
*/
/* free the just unmapped extents */
error = xfs_defer_finish(&tp);
if (error)
goto out;
error = xfs_trans_roll_inode(&tp, ip);
if (error)
goto out;
}
if (whichfork == XFS_DATA_FORK) {