Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Some minor improvements for zoned mode
@ 2025-09-18 13:01 Damien Le Moal
  2025-09-18 13:01 ` [PATCH v2 1/2] xfs: improve zone statistics message Damien Le Moal
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Damien Le Moal @ 2025-09-18 13:01 UTC (permalink / raw)
  To: Carlos Maiolino, linux-xfs; +Cc: Christoph Hellwig

A couple of patches to improve a mount meaasge and to improve (reduce)
the default maximum number of open zones for large capacity regular
devices using the zoned allocatror.

Changes from v1:
 - Improved XFS_DEFAULT_MAX_OPEN_ZONES description comment.
 - Removed capitalization from commit titles 
 - Added review tags

Damien Le Moal (2):
  xfs: improve zone statistics message
  xfs: improve default maximum number of open zones

 fs/xfs/libxfs/xfs_zones.h | 7 +++++++
 fs/xfs/xfs_zone_alloc.c   | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] xfs: improve zone statistics message
  2025-09-18 13:01 [PATCH v2 0/2] Some minor improvements for zoned mode Damien Le Moal
@ 2025-09-18 13:01 ` Damien Le Moal
  2025-09-18 13:01 ` [PATCH v2 2/2] xfs: improve default maximum number of open zones Damien Le Moal
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Damien Le Moal @ 2025-09-18 13:01 UTC (permalink / raw)
  To: Carlos Maiolino, linux-xfs; +Cc: Christoph Hellwig

Reword the information message displayed in xfs_mount_zones()
indicating the total zone count and maximum number of open zones.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 fs/xfs/xfs_zone_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c
index 23a027387933..f152b2182004 100644
--- a/fs/xfs/xfs_zone_alloc.c
+++ b/fs/xfs/xfs_zone_alloc.c
@@ -1244,7 +1244,7 @@ xfs_mount_zones(
 	if (!mp->m_zone_info)
 		return -ENOMEM;
 
-	xfs_info(mp, "%u zones of %u blocks size (%u max open)",
+	xfs_info(mp, "%u zones of %u blocks (%u max open zones)",
 		 mp->m_sb.sb_rgcount, mp->m_groups[XG_TYPE_RTG].blocks,
 		 mp->m_max_open_zones);
 	trace_xfs_zones_mount(mp);
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] xfs: improve default maximum number of open zones
  2025-09-18 13:01 [PATCH v2 0/2] Some minor improvements for zoned mode Damien Le Moal
  2025-09-18 13:01 ` [PATCH v2 1/2] xfs: improve zone statistics message Damien Le Moal
@ 2025-09-18 13:01 ` Damien Le Moal
  2025-09-18 15:28 ` [PATCH v2 0/2] Some minor improvements for zoned mode Darrick J. Wong
  2025-09-19 16:15 ` Carlos Maiolino
  3 siblings, 0 replies; 5+ messages in thread
From: Damien Le Moal @ 2025-09-18 13:01 UTC (permalink / raw)
  To: Carlos Maiolino, linux-xfs; +Cc: Christoph Hellwig

For regular block devices using the zoned allocator, the default
maximum number of open zones is set to 1/4 of the number of realtime
groups. For a large capacity device, this leads to a very large limit.
E.g. with a 26 TB HDD:

mount /dev/sdb /mnt
...
XFS (sdb): 95836 zones of 65536 blocks size (23959 max open)

In turn such large limit on the number of open zones can lead, depending
on the workload, on a very large number of concurrent write streams
which devices generally do not handle well, leading to poor performance.

Introduce the default limit XFS_DEFAULT_MAX_OPEN_ZONES, defined as 128
to match the hardware limit of most SMR HDDs available today, and use
this limit to set mp->m_max_open_zones in xfs_calc_open_zones() instead
of calling xfs_max_open_zones(), when the user did not specify a limit
with the max_open_zones mount option.

For the 26 TB HDD example, we now get:

mount /dev/sdb /mnt
...
XFS (sdb): 95836 zones of 65536 blocks (128 max open zones)

This change does not prevent the user from specifying a lareger number
for the open zones limit. E.g.

mount -o max_open_zones=4096 /dev/sdb /mnt
...
XFS (sdb): 95836 zones of 65536 blocks (4096 max open zones)

Finally, since xfs_calc_open_zones() checks and caps the
mp->m_max_open_zones limit against the value calculated by
xfs_max_open_zones() for any type of device, this new default limit does
not increase m_max_open_zones for small capacity devices.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 fs/xfs/libxfs/xfs_zones.h | 7 +++++++
 fs/xfs/xfs_zone_alloc.c   | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_zones.h b/fs/xfs/libxfs/xfs_zones.h
index c4f1367b2cca..5fefd132e002 100644
--- a/fs/xfs/libxfs/xfs_zones.h
+++ b/fs/xfs/libxfs/xfs_zones.h
@@ -29,6 +29,13 @@ struct xfs_rtgroup;
 #define XFS_OPEN_GC_ZONES	1U
 #define XFS_MIN_OPEN_ZONES	(XFS_OPEN_GC_ZONES + 1U)
 
+/*
+ * For zoned devices that do not have a limit on the number of open zones, and
+ * for regular devices using the zoned allocator, use the most common SMR disks
+ * limit (128) as the default limit on the number of open zones.
+ */
+#define XFS_DEFAULT_MAX_OPEN_ZONES	128
+
 bool xfs_zone_validate(struct blk_zone *zone, struct xfs_rtgroup *rtg,
 	xfs_rgblock_t *write_pointer);
 
diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c
index f152b2182004..1147bacb2da8 100644
--- a/fs/xfs/xfs_zone_alloc.c
+++ b/fs/xfs/xfs_zone_alloc.c
@@ -1131,7 +1131,7 @@ xfs_calc_open_zones(
 		if (bdev_open_zones)
 			mp->m_max_open_zones = bdev_open_zones;
 		else
-			mp->m_max_open_zones = xfs_max_open_zones(mp);
+			mp->m_max_open_zones = XFS_DEFAULT_MAX_OPEN_ZONES;
 	}
 
 	if (mp->m_max_open_zones < XFS_MIN_OPEN_ZONES) {
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/2] Some minor improvements for zoned mode
  2025-09-18 13:01 [PATCH v2 0/2] Some minor improvements for zoned mode Damien Le Moal
  2025-09-18 13:01 ` [PATCH v2 1/2] xfs: improve zone statistics message Damien Le Moal
  2025-09-18 13:01 ` [PATCH v2 2/2] xfs: improve default maximum number of open zones Damien Le Moal
@ 2025-09-18 15:28 ` Darrick J. Wong
  2025-09-19 16:15 ` Carlos Maiolino
  3 siblings, 0 replies; 5+ messages in thread
From: Darrick J. Wong @ 2025-09-18 15:28 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: Carlos Maiolino, linux-xfs, Christoph Hellwig

On Thu, Sep 18, 2025 at 10:01:09PM +0900, Damien Le Moal wrote:
> A couple of patches to improve a mount meaasge and to improve (reduce)
> the default maximum number of open zones for large capacity regular
> devices using the zoned allocatror.

That all looks fine to me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> 
> Changes from v1:
>  - Improved XFS_DEFAULT_MAX_OPEN_ZONES description comment.
>  - Removed capitalization from commit titles 
>  - Added review tags
> 
> Damien Le Moal (2):
>   xfs: improve zone statistics message
>   xfs: improve default maximum number of open zones
> 
>  fs/xfs/libxfs/xfs_zones.h | 7 +++++++
>  fs/xfs/xfs_zone_alloc.c   | 4 ++--
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> -- 
> 2.51.0
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/2] Some minor improvements for zoned mode
  2025-09-18 13:01 [PATCH v2 0/2] Some minor improvements for zoned mode Damien Le Moal
                   ` (2 preceding siblings ...)
  2025-09-18 15:28 ` [PATCH v2 0/2] Some minor improvements for zoned mode Darrick J. Wong
@ 2025-09-19 16:15 ` Carlos Maiolino
  3 siblings, 0 replies; 5+ messages in thread
From: Carlos Maiolino @ 2025-09-19 16:15 UTC (permalink / raw)
  To: linux-xfs, Damien Le Moal; +Cc: Christoph Hellwig

On Thu, 18 Sep 2025 22:01:09 +0900, Damien Le Moal wrote:
> A couple of patches to improve a mount meaasge and to improve (reduce)
> the default maximum number of open zones for large capacity regular
> devices using the zoned allocatror.
> 
> Changes from v1:
>  - Improved XFS_DEFAULT_MAX_OPEN_ZONES description comment.
>  - Removed capitalization from commit titles
>  - Added review tags
> 
> [...]

Applied to for-next, thanks!

[1/2] xfs: improve zone statistics message
      commit: 8e1cfa51320da0cf599d286c89db043f329ca6b0
[2/2] xfs: improve default maximum number of open zones
      commit: ff3d90903f8f525eedb26efe6fea03c39476cb69

Best regards,
-- 
Carlos Maiolino <cem@kernel.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-09-19 16:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18 13:01 [PATCH v2 0/2] Some minor improvements for zoned mode Damien Le Moal
2025-09-18 13:01 ` [PATCH v2 1/2] xfs: improve zone statistics message Damien Le Moal
2025-09-18 13:01 ` [PATCH v2 2/2] xfs: improve default maximum number of open zones Damien Le Moal
2025-09-18 15:28 ` [PATCH v2 0/2] Some minor improvements for zoned mode Darrick J. Wong
2025-09-19 16:15 ` Carlos Maiolino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox