[PATCH 3/3] xfs: adjust the hint based zone allocation policy

Hans Holmberg posted 3 patches 3 months, 1 week ago
[PATCH 3/3] xfs: adjust the hint based zone allocation policy
Posted by Hans Holmberg 3 months, 1 week ago
As we really can't make any general assumptions about files that don't
have any life time hint set or are set to "NONE", adjust the allocation
policy to avoid co-locating data from those files with files with a set
life time.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
---
 fs/xfs/xfs_zone_alloc.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c
index ff24769b8870..23a027387933 100644
--- a/fs/xfs/xfs_zone_alloc.c
+++ b/fs/xfs/xfs_zone_alloc.c
@@ -512,17 +512,11 @@ static const unsigned int
 xfs_zoned_hint_score[WRITE_LIFE_HINT_NR][WRITE_LIFE_HINT_NR] = {
 	[WRITE_LIFE_NOT_SET]	= {
 		[WRITE_LIFE_NOT_SET]	= XFS_ZONE_ALLOC_OK,
-		[WRITE_LIFE_NONE]	= XFS_ZONE_ALLOC_OK,
-		[WRITE_LIFE_SHORT]	= XFS_ZONE_ALLOC_OK,
 	},
 	[WRITE_LIFE_NONE]	= {
-		[WRITE_LIFE_NOT_SET]	= XFS_ZONE_ALLOC_OK,
-		[WRITE_LIFE_NONE]	= XFS_ZONE_ALLOC_GOOD,
-		[WRITE_LIFE_SHORT]	= XFS_ZONE_ALLOC_GOOD,
+		[WRITE_LIFE_NONE]	= XFS_ZONE_ALLOC_OK,
 	},
 	[WRITE_LIFE_SHORT]	= {
-		[WRITE_LIFE_NOT_SET]	= XFS_ZONE_ALLOC_GOOD,
-		[WRITE_LIFE_NONE]	= XFS_ZONE_ALLOC_GOOD,
 		[WRITE_LIFE_SHORT]	= XFS_ZONE_ALLOC_GOOD,
 	},
 	[WRITE_LIFE_MEDIUM]	= {
-- 
2.34.1
Re: [PATCH 3/3] xfs: adjust the hint based zone allocation policy
Posted by hch 3 months, 1 week ago
On Mon, Sep 01, 2025 at 10:52:05AM +0000, Hans Holmberg wrote:
> As we really can't make any general assumptions about files that don't
> have any life time hint set or are set to "NONE", adjust the allocation
> policy to avoid co-locating data from those files with files with a set
> life time.
> 
> Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>