From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Chandan Babu R <chandan.babu@oracle.com>,
"Darrick J. Wong" <djwong@kernel.org>,
linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/4] xfs: create perag structures as soon as possible during log recovery
Date: Fri, 20 Sep 2024 07:50:00 +1000 [thread overview]
Message-ID: <ZuyciHNmweoltuA4@dread.disaster.area> (raw)
In-Reply-To: <20240919074631.GA23841@lst.de>
On Thu, Sep 19, 2024 at 09:46:31AM +0200, Christoph Hellwig wrote:
> On Thu, Sep 19, 2024 at 11:09:40AM +1000, Dave Chinner wrote:
> > Ideally, we should not be using the new AGs until *after* the growfs
> > transaction has hit stable storage (i.e. the journal has fully
> > commmitted the growfs transaction), not just committed to the CIL.
>
> Yes. A crude version of that - freeze/unfreeze before setting the
> AG live was my other initial idea, but Darrick wasn't exactly
> excited about that..
I'm not exactly excited by that idea, either...
> > The second step is preventing allocations that are running from
> > seeing the mp->m_sb.sb_agcount update until after the transaction is
> > stable.
>
> Or just not seeing the pag as active by not setting the initial
> active reference until after the transaction is stable. Given
> all the issues outlined by you about sb locking that might be the
> easier approach.
Yeah, that's a good idea for avoiding perag references from
iterations before the growfs is stable.
However, my concern is whether that is sufficient. Whilst I didn't
mention it, changing sb_agcount and sb_dblocks before the grwofs is
stable affects things like size calculations for the old end runt
AG(*) because it is no longer considered a runt the moment we change
the in-memory size fields in the superblock. That will, at least,
affect ino/fsbno/agbno verification, as well as corruption checks
through the code.
An alternative is to delay the perag initialisation until after the
growfs is stable, because we don't want the old runt AG size to
visibly change until after the growfs is stable.
There may be more potential issues, but I haven't done a careful
code audit and that's kinda why I suggested simply delaying the
in-memory state update. Delaying the update removes the whole
in-memory transient state situation altogether...
-Dave.
(*) The precalculated AG length and inode min/max values we've added
to the perag (calculated at perag init time) should be used for
these calculations. That gets around this 'growfs changes sb values
dynamically' issue, but not all the places where we do these
verifications have a valid perag reference to pass these
functions.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2024-09-19 21:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 4:28 fix recovery of extfree items just after a growfs Christoph Hellwig
2024-09-10 4:28 ` [PATCH 1/4] xfs: pass the exact range to initialize to xfs_initialize_perag Christoph Hellwig
2024-09-17 18:50 ` Darrick J. Wong
2024-09-18 6:15 ` Christoph Hellwig
2024-09-10 4:28 ` [PATCH 2/4] xfs: merge the perag freeing helpers Christoph Hellwig
2024-09-17 18:55 ` Darrick J. Wong
2024-09-18 6:15 ` Christoph Hellwig
2024-09-10 4:28 ` [PATCH 3/4] xfs: create perag structures as soon as possible during log recovery Christoph Hellwig
2024-09-16 1:28 ` Dave Chinner
2024-09-18 6:11 ` Christoph Hellwig
2024-09-19 1:09 ` Dave Chinner
2024-09-19 7:46 ` Christoph Hellwig
2024-09-19 21:50 ` Dave Chinner [this message]
2024-09-10 4:28 ` [PATCH 4/4] xfs: don't use __GFP_RETRY_MAYFAIL Christoph Hellwig
2024-09-17 19:00 ` Darrick J. Wong
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=ZuyciHNmweoltuA4@dread.disaster.area \
--to=david@fromorbit.com \
--cc=chandan.babu@oracle.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