Re: [RFC PATCH] xfs: add mount option for zone gc pressure

Dave Chinner
2025-03-20T21:22:08Z

On Thu, Mar 20, 2025 at 12:51:24PM +0000, Hans Holmberg wrote:
> On 19/03/2025 10:11, Dave Chinner wrote:
> > On Wed, Mar 19, 2025 at 08:19:19AM +0000, Hans Holmberg wrote:
> >> +
> >> + free = xfs_estimate_freecounter(mp, XC_FREE_RTEXTENTS);
> >> + if (available < div_s64(free * mp->m_gc_pressure, 100))
> >
> > mult_frac(free, mp->m_gc_pressure, 100) to avoid overflow.
> >
> > Also, this is really a free space threshold, not a dynamic
> > "pressure" measurement...
> >
>
> Yeah, naming is hard. I can't come up with a better name off
> the bat, but I'll give it some thought.

The current lowspace thresholds are called:

struct xfs_mount {
....
uint64_t m_low_space[XFS_LOWSP_MAX];
uint64_t m_low_rtexts[XFS_LOWSP_MAX];
.....

As we have multiple thresholds that increase severity of action
as we get closer and closer to ENOSPC. These are pre-calculated
as fixed values so we don't have to do mult/div when checking low
space thresholds on every allocation.

And note that in the xfs_mount we also have:

void __percpu *m_inodegc; /* percpu inodegc structures */
.....
struct workqueue_struct *m_blockgc_wq;
struct workqueue_struct *m_inodegc_wq;
.....
struct shrinker *m_inodegc_shrinker;
.....
struct cpumask m_inodegc_cpumask;
.....

Multiple different subsystem GC state fields. Hence anything related
to zone GC really needs a m_zonegc_... prefix.

So my 2c worth is that something like "m_zonegc_low_space" would be
appropriate as it indicates that it is for zonegc (rather than
blockgc or inodegc), and it's a low space threshold...

-Dave.
--
Dave Chinner
david@fromorbit.com