]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xfs: cache open zone in inode->i_private
authorChristoph Hellwig <hch@lst.de>
Fri, 17 Oct 2025 03:55:41 +0000 (05:55 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 21 Oct 2025 09:32:50 +0000 (11:32 +0200)
commitca3d643a970139f5456f90dd555a0955752d70cb
treeafff7d0607e0a40f3a340de0c2d972afcf04e27c
parenta8c861f401b4b2f8feda282abff929fa91c1f73a
xfs: cache open zone in inode->i_private

The MRU cache for open zones is unfortunately still not ideal, as it can
time out pretty easily when doing heavy I/O to hard disks using up most
or all open zones.  One option would be to just increase the timeout,
but while looking into that I realized we're just better off caching it
indefinitely as there is no real downside to that once we don't hold a
reference to the cache open zone.

So switch the open zone to RCU freeing, and then stash the last used
open zone into inode->i_private.  This helps to significantly reduce
fragmentation by keeping I/O localized to zones for workloads that
write using many open files to HDD.

Fixes: 4e4d52075577 ("xfs: add the zoned space allocator")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Tested-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_mount.h
fs/xfs/xfs_super.c
fs/xfs/xfs_zone_alloc.c
fs/xfs/xfs_zone_priv.h