diff options
| author | John Garry <[email protected]> | 2025-05-07 21:18:32 +0000 |
|---|---|---|
| committer | Darrick J. Wong <[email protected]> | 2025-05-07 21:25:32 +0000 |
| commit | 0c438dcc31504bf4f50b20dc52f8f5ca7fab53e2 (patch) | |
| tree | fa32c226ab176a12fe33b0eaeda15f2d90e2325f /drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | |
| parent | xfs: add xfs_file_dio_write_atomic() (diff) | |
| download | kernel-0c438dcc31504bf4f50b20dc52f8f5ca7fab53e2.tar.gz kernel-0c438dcc31504bf4f50b20dc52f8f5ca7fab53e2.zip | |
xfs: add xfs_calc_atomic_write_unit_max()
Now that CoW-based atomic writes are supported, update the max size of an
atomic write for the data device.
The limit of a CoW-based atomic write will be the limit of the number of
logitems which can fit into a single transaction.
In addition, the max atomic write size needs to be aligned to the agsize.
Limit the size of atomic writes to the greatest power-of-two factor of the
agsize so that allocations for an atomic write will always be aligned
compatibly with the alignment requirements of the storage.
Function xfs_atomic_write_logitems() is added to find the limit the number
of log items which can fit in a single transaction.
Amend the max atomic write computation to create a new transaction
reservation type, and compute the maximum size of an atomic write
completion (in fsblocks) based on this new transaction reservation.
Initially, tr_atomic_write is a clone of tr_itruncate, which provides a
reasonable level of parallelism. In the next patch, we'll add a mount
option so that sysadmins can configure their own limits.
[djwong: use a new reservation type for atomic write ioends, refactor
group limit calculations]
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
[jpg: rounddown power-of-2 always]
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: John Garry <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c')
0 files changed, 0 insertions, 0 deletions
