public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Carlos Maiolino <cem@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Hans Holmberg <hans.holmberg@wdc.com>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/2] xfs: expose the current zonegc required status in sysfs
Date: Mon, 20 Apr 2026 18:09:24 +0200	[thread overview]
Message-ID: <aeZPtHgVAieyBEqo@ryzen> (raw)
In-Reply-To: <41e7ced6-90c0-423a-9a90-4bfa263bdb31@kernel.org>

On Mon, Apr 20, 2026 at 05:47:55PM +0200, Damien Le Moal wrote:
> On 2026/04/20 15:50, Niklas Cassel wrote:
> > The current zonegc required status is currently available in
> > /proc/<pid>/mountstats (which contains stats for all mounted zoned XFS
> > filesystems), under "RT GC required:".
> > 
> > Add a sysfs attribute /sys/fs/xfs/<dev>/zoned/zonegc_required for the same.
> > This makes it trivial for monitoring software to read the value, for a
> > specific filesystem, without any complex parsing.
> > 
> > Signed-off-by: Niklas Cassel <cassel@kernel.org>
> 
> As is, I think this is OK, but I wonder if we should not instead call the
> attribute zonegc_running and use xfs_is_zonegc_running() to test the
> XFS_OPSTATE_ZONEGC_RUNNING flag for the attribute value ?
> 
> The reasoning here is that the GC thread also does zone reset for zones with all
> blocks invalidated, and in such case we may start the GC thread even when
> xfs_zoned_need_gc() is false.
> 
> And I think it is more interesting to see if the GC thread is running, so doing IOs.
> 
> Thoughts ?

I did originally create two patches:

This patch, which does exactly like "RT GC required:" in /proc/<pid>/mountstats
(which also calls xfs_zoned_need_gc()).

Another patch that added another sysfs attribute:
/sys/fs/xfs/<dev>/zoned/zonegc_running
which like you said, calls xfs_is_zonegc_running(zoned_to_mp(kobj))).

However, I couldn't come up with a good argument for adding two new sysfs
attributes that are more or less the same thing, therefore I chose the
attribute which is equivalent to what we already expose via mountstats.


If you think it is a good idea to have both, then I could just dig up my
patch from the git reflog, and sent it as well.

However, I think if we add such "GC running" attribute, then for consistency,
shouldn't we add the same also to mountstats?


BTW.. didn't you think about moving the zone resets out from the GC thread?
If we ever do submit such a patch, then the two attributes would always have
the same value. So perhaps we should hold off with adding two attributes until
we know for sure if we will move the zone resets out from the GC thread or not?


Kind regards,
Niklas

      reply	other threads:[~2026-04-20 16:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 13:50 [PATCH 0/2] xfs: add additional zoned sysfs attributes Niklas Cassel
2026-04-20 13:50 ` [PATCH 1/2] xfs: expose the number of free zones in sysfs Niklas Cassel
2026-04-20 15:39   ` Damien Le Moal
2026-04-20 13:50 ` [PATCH 2/2] xfs: expose the current zonegc required status " Niklas Cassel
2026-04-20 15:47   ` Damien Le Moal
2026-04-20 16:09     ` Niklas Cassel [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=aeZPtHgVAieyBEqo@ryzen \
    --to=cassel@kernel.org \
    --cc=cem@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=hans.holmberg@wdc.com \
    --cc=hch@lst.de \
    --cc=johannes.thumshirn@wdc.com \
    --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