public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Hans Holmberg <Hans.Holmberg@wdc.com>
Cc: "linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	"Darrick J . Wong" <djwong@kernel.org>, hch <hch@lst.de>
Subject: Re: [RFC PATCH] xfs: add mount option for zone gc pressure
Date: Fri, 21 Mar 2025 08:22:02 +1100	[thread overview]
Message-ID: <Z9yG-sn0IHFDUEvZ@dread.disaster.area> (raw)
In-Reply-To: <caaff621-2da9-4c7a-b6c1-76cd2317022b@wdc.com>

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

      reply	other threads:[~2025-03-20 21:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19  8:19 [RFC PATCH] xfs: add mount option for zone gc pressure Hans Holmberg
2025-03-19  9:11 ` Dave Chinner
2025-03-20  6:58   ` hch
2025-03-20 12:51   ` Hans Holmberg
2025-03-20 21:22     ` Dave Chinner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z9yG-sn0IHFDUEvZ@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=Hans.Holmberg@wdc.com \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox