diff options
| author | Damien Le Moal <dlemoal@kernel.org> | 2025-10-14 13:19:45 +0900 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2025-10-21 09:49:39 +0200 |
| commit | b00bcb190eef35ae4da3c424b8a72f287e69f650 (patch) | |
| tree | 3794d6d56bdc1d1cc27007a8b725bfd5efa43ff4 /lib/timerqueue.c | |
| parent | 914f377075d646b4695a7868ba090f4c714dfd4b (diff) | |
xfs: do not tightly pack-write large files
When using a zoned realtime device, tightly packing of data blocks
belonging to multiple closed files into the same realtime group (RTG)
is very efficient at improving write performance. This is especially
true with SMR HDDs as this can reduce, and even suppress, disk head
seeks.
However, such tight packing does not make sense for large files that
require at least a full RTG. If tight packing placement is applied for
such files, the VM writeback thread switching between inodes result in
the large files to be fragmented, thus increasing the garbage collection
penalty later when the RTG needs to be reclaimed.
This problem can be avoided with a simple heuristic: if the size of the
inode being written back is at least equal to the RTG size, do not use
tight-packing. Modify xfs_zoned_pack_tight() to always return false in
this case.
With this change, a multi-writer workload writing files of 256 MB on a
file system backed by an SMR HDD with 256 MB zone size as a realtime
device sees all files occupying exactly one RTG (i.e. one device zone),
thus completely removing the heavy fragmentation observed without this
change.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Diffstat (limited to 'lib/timerqueue.c')
0 files changed, 0 insertions, 0 deletions
