diff options
| author | Christoph Hellwig <[email protected]> | 2025-07-16 12:54:06 +0000 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2025-07-24 15:30:14 +0000 |
| commit | 7cbbfd27a929398f027f0e8d01c80264f47db4e4 (patch) | |
| tree | 0aed5a10b0e603fa7aab5c3a1cf35b84a31dc159 /fs/xfs/xfs_zone_alloc.c | |
| parent | xfs: stop passing an inode to the zone space reservation helpers (diff) | |
| download | kernel-7cbbfd27a929398f027f0e8d01c80264f47db4e4.tar.gz kernel-7cbbfd27a929398f027f0e8d01c80264f47db4e4.zip | |
xfs: improve the comments in xfs_max_open_zones
Describe the rationale for the decisions a bit better.
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'fs/xfs/xfs_zone_alloc.c')
| -rw-r--r-- | fs/xfs/xfs_zone_alloc.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c index 729d80ff52c1..6a123d3dd62d 100644 --- a/fs/xfs/xfs_zone_alloc.c +++ b/fs/xfs/xfs_zone_alloc.c @@ -1114,24 +1114,27 @@ xfs_get_zone_info_cb( } /* - * Calculate the max open zone limit based on the of number of - * backing zones available + * Calculate the max open zone limit based on the of number of backing zones + * available. */ static inline uint32_t xfs_max_open_zones( struct xfs_mount *mp) { unsigned int max_open, max_open_data_zones; + /* - * We need two zones for every open data zone, - * one in reserve as we don't reclaim open zones. One data zone - * and its spare is included in XFS_MIN_ZONES. + * We need two zones for every open data zone, one in reserve as we + * don't reclaim open zones. One data zone and its spare is included + * in XFS_MIN_ZONES to support at least one user data writer. */ max_open_data_zones = (mp->m_sb.sb_rgcount - XFS_MIN_ZONES) / 2 + 1; max_open = max_open_data_zones + XFS_OPEN_GC_ZONES; /* - * Cap the max open limit to 1/4 of available space + * Cap the max open limit to 1/4 of available space. Without this we'd + * run out of easy reclaim targets too quickly and storage devices don't + * handle huge numbers of concurrent write streams overly well. */ max_open = min(max_open, mp->m_sb.sb_rgcount / 4); |
