Skip to content

Commit b22a194

Browse files
committed
Merge tag 'xfs-fixes-6.15-rc4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs fixes from Carlos Maiolino: "This contains a fix for a build failure on some 32-bit architectures and a warning generating docs" * tag 'xfs-fixes-6.15-rc4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: remove duplicate Zoned Filesystems sections in admin-guide XFS: fix zoned gc threshold math for 32-bit arches
2 parents eef0dc0 + f0447f8 commit b22a194

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

Documentation/admin-guide/xfs.rst

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ The interesting knobs for XFS workqueues are as follows:
562562
Zoned Filesystems
563563
=================
564564

565-
For zoned file systems, the following attribute is exposed in:
565+
For zoned file systems, the following attributes are exposed in:
566566

567567
/sys/fs/xfs/<dev>/zoned/
568568

@@ -572,23 +572,10 @@ For zoned file systems, the following attribute is exposed in:
572572
is limited by the capabilities of the backing zoned device, file system
573573
size and the max_open_zones mount option.
574574

575-
Zoned Filesystems
576-
=================
577-
578-
For zoned file systems, the following attributes are exposed in:
579-
580-
/sys/fs/xfs/<dev>/zoned/
581-
582-
max_open_zones (Min: 1 Default: Varies Max: UINTMAX)
583-
This read-only attribute exposes the maximum number of open zones
584-
available for data placement. The value is determined at mount time and
585-
is limited by the capabilities of the backing zoned device, file system
586-
size and the max_open_zones mount option.
587-
588-
zonegc_low_space (Min: 0 Default: 0 Max: 100)
589-
Define a percentage for how much of the unused space that GC should keep
590-
available for writing. A high value will reclaim more of the space
591-
occupied by unused blocks, creating a larger buffer against write
592-
bursts at the cost of increased write amplification. Regardless
593-
of this value, garbage collection will always aim to free a minimum
594-
amount of blocks to keep max_open_zones open for data placement purposes.
575+
zonegc_low_space (Min: 0 Default: 0 Max: 100)
576+
Define a percentage for how much of the unused space that GC should keep
577+
available for writing. A high value will reclaim more of the space
578+
occupied by unused blocks, creating a larger buffer against write
579+
bursts at the cost of increased write amplification. Regardless
580+
of this value, garbage collection will always aim to free a minimum
581+
amount of blocks to keep max_open_zones open for data placement purposes.

fs/xfs/xfs_zone_gc.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ bool
170170
xfs_zoned_need_gc(
171171
struct xfs_mount *mp)
172172
{
173-
s64 available, free;
173+
s64 available, free, threshold;
174+
s32 remainder;
174175

175176
if (!xfs_group_marked(mp, XG_TYPE_RTG, XFS_RTG_RECLAIMABLE))
176177
return false;
@@ -183,7 +184,12 @@ xfs_zoned_need_gc(
183184
return true;
184185

185186
free = xfs_estimate_freecounter(mp, XC_FREE_RTEXTENTS);
186-
if (available < mult_frac(free, mp->m_zonegc_low_space, 100))
187+
188+
threshold = div_s64_rem(free, 100, &remainder);
189+
threshold = threshold * mp->m_zonegc_low_space +
190+
remainder * div_s64(mp->m_zonegc_low_space, 100);
191+
192+
if (available < threshold)
187193
return true;
188194

189195
return false;

0 commit comments

Comments
 (0)