From: Dave Chinner <dgc@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
Pedro Demarchi Gomes <pedrodemargomes@gmail.com>,
Carlos Maiolino <cem@kernel.org>,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuangpeng Bai <shuangpeng.kernel@gmail.com>
Subject: Re: [PATCH] xfs: start inodegc after quota initialization
Date: Thu, 16 Apr 2026 10:55:38 +1000 [thread overview]
Message-ID: <aeAziq2qsiCrvwBZ@dread> (raw)
In-Reply-To: <ad89k-qafk3jsx35@infradead.org>
On Wed, Apr 15, 2026 at 12:26:11AM -0700, Christoph Hellwig wrote:
> On Mon, Apr 13, 2026 at 11:09:40AM -0700, Darrick J. Wong wrote:
> > > index ef1ea8a1238c..d6f75ab41337 100644
> > > --- a/fs/xfs/xfs_mount.c
> > > +++ b/fs/xfs/xfs_mount.c
> > > @@ -1057,7 +1057,6 @@ xfs_mountfs(
> > > xfs_clear_using_logged_xattrs(mp);
> > >
> > > /* Enable background inode inactivation workers. */
> > > - xfs_inodegc_start(mp);
> > > xfs_blockgc_start(mp);
> > >
> > > if (xfs_has_metadir(mp)) {
> > > @@ -1143,6 +1142,8 @@ xfs_mountfs(
> > > }
> > > }
> > >
> > > + xfs_inodegc_start(mp);
> >
> > Why is it correct to defer inodegc until this point? Can any code
> > between line 1060 and 1145 push an inode to the inodegc mechanism?
> > blockgc can unmap blocks from files, so why is it ok to leave the
> > blockgc_start call where it is?
>
> Looking at this - I think actually performing inodegc before quotas
> are up sounds dangerous, as we'd miss th quota accounting. So I
> think we need to defer starting the runners after that. But we
> should support queuing up inodes before that. blockgc has
> the same issues.
Chicken and egg.
inodegc has to be up before the first xfs_iget() call is made,
because releasing an inode could require inodegc to run to allow it
to be freed.
We are bringing all the metadir inodes, the root inode, the realtime
inodes, etc into memory before we start up quota. With the above in
mind, inodegc needs to be running to ensure we clean up and free all
inodes if mount fails anywhere along the path before quotas are
brought up....
-Dave.
--
Dave Chinner
dgc@kernel.org
prev parent reply other threads:[~2026-04-16 0:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 0:49 [PATCH] xfs: start inodegc after quota initialization Pedro Demarchi Gomes
2026-04-13 18:09 ` Darrick J. Wong
2026-04-15 7:26 ` Christoph Hellwig
2026-04-15 15:12 ` Darrick J. Wong
2026-04-16 0:55 ` 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=aeAziq2qsiCrvwBZ@dread \
--to=dgc@kernel.org \
--cc=cem@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=pedrodemargomes@gmail.com \
--cc=shuangpeng.kernel@gmail.com \
/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