diff options
| author | Pankaj Raghav <p.raghav@samsung.com> | 2026-10-08 13:11:47 +0200 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2026-10-14 10:18:10 +0200 |
| commit | ec8f62cc109a3f596b3c65dc0f1011c209239051 (patch) | |
| tree | 1f3808f87d137e4ed90daf91de6863dca088fa72 /tools/lib/python | |
| parent | b47fb1ed0221fd21e696b468ed9eb40dd3c21f4d (diff) | |
| download | linux-next-ec8f62cc109a3f596b3c65dc0f1011c209239051.tar.gz linux-next-ec8f62cc109a3f596b3c65dc0f1011c209239051.zip | |
xfs: don't limit software atomic writes by the group alignment
xfs_calc_group_awu_max() clamps the atomic write unit maximum to the
greatest power-of-two factor of the group size when the device advertises
atomic writes, so that allocations can be made naturally aligned for
REQ_ATOMIC. But that value is the software limit: it is only used when
reflink is enabled, and out of place writes through the COW fork have no
alignment requirement.
Compute the software limit from the group size alone, and apply the
alignment constraint in xfs_get_atomic_write_max_opt() instead, which is
what reports the size that can be offloaded to the hardware.
Results on a 14TB device with 16k hardware atomic support with 16k
blocksize:
Without patches:
[nix-shell:~]# trace-cmd report
cpus=16
mount-617 [009] 1184.719159: xfs_calc_atomic_write_unit_max: dev 259:2 ag
max_write 131072 max_ioend 4096 max_gsize 2 awu_max 2
[nix-shell:~]# ./statx /media/test/hello.txt
/media/test/hello.txt:
stx_atomic_write_unit_min: 16384
stx_atomic_write_unit_max: 32768
stx_atomic_write_unit_max_opt: 16384
stx_atomic_write_segments_max: 1
With patches:
[nix-shell:~]# trace-cmd report
cpus=16
mount-598 [005] 319.692000: xfs_calc_atomic_write_unit_max: dev 259:2 ag
max_write 131072 max_ioend 4096 max_gsize 33554432 awu_max 4096
[nix-shell:~]# ./statx /media/test/hello.txt
/media/test/hello.txt:
stx_atomic_write_unit_min: 16384
stx_atomic_write_unit_max: 67108864
stx_atomic_write_unit_max_opt: 16384
stx_atomic_write_segments_max: 1
Fixes: 0c438dcc3150 ("xfs: add xfs_calc_atomic_write_unit_max()")
Assisted-by: LLM
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Reviewed-by: John Garry <john.garry@linux.dev>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
