]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: always allocate the free zone with the lowest index
authorHans Holmberg <hans.holmberg@wdc.com>
Tue, 20 Jan 2026 08:57:46 +0000 (09:57 +0100)
committerCarlos Maiolino <cem@kernel.org>
Wed, 21 Jan 2026 11:57:17 +0000 (12:57 +0100)
commit01a28961549ac9c387ccd5eb00d58be1d8c2794b
tree073b0c5190c9a4bfb63ada9dfab5f18618ca8dbe
parent4d6d335ea9558a7dc0c5044886440d7223596235
xfs: always allocate the free zone with the lowest index

Zones in the beginning of the address space are typically mapped to
higer bandwidth tracks on HDDs than those at the end of the address
space. So, in stead of allocating zones "round robin" across the whole
address space, always allocate the zone with the lowest index.

This increases average write bandwidth for overwrite workloads
when less than the full capacity is being used. At ~50% utilization
this improves bandwidth for a random file overwrite benchmark
with 128MiB files and 256MiB zone capacity by 30%.

Running the same benchmark with small 2-8 MiB files at 67% capacity
shows no significant difference in performance. Due to heavy
fragmentation the whole zone range is in use, greatly limiting the
number of free zones with high bw.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_zone_alloc.c
fs/xfs/xfs_zone_priv.h