xfs: add inode to zone caching for data placement
authorHans Holmberg <Hans.Holmberg@wdc.com>
Wed, 14 May 2025 10:50:37 +0000 (10:50 +0000)
committerCarlos Maiolino <cem@kernel.org>
Wed, 14 May 2025 17:00:17 +0000 (19:00 +0200)
commitf3e2e53823b98d55da46ea72d32ac18bd7709c33
tree502a80e446994a68f55f9f485ac46f43d4ee935c
parent70b95cb86513d7f6d084ddc8e961a1cab9022e14
xfs: add inode to zone caching for data placement

Placing data from the same file in the same zone is a great heuristic
for reducing write amplification and we do this already - but only
for sequential writes.

To support placing data in the same way for random writes, reuse the
xfs mru cache to map inodes to open zones on first write. If a mapping
is present, use the open zone for data placement for this file until
the zone is full.

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