From: Gao Xiang <hsiangkao@redhat.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org, "Darrick J. Wong" <djwong@kernel.org>,
Dave Chinner <dchinner@redhat.com>, Zorro Lang <zlang@redhat.com>
Subject: Re: [PATCH] xfs: update superblock counters correctly for !lazysbcount
Date: Tue, 27 Apr 2021 22:30:07 +0800 [thread overview]
Message-ID: <20210427143007.GC103178@xiangao.remote.csb> (raw)
In-Reply-To: <YIge2/FRLy4Xjvcp@bfoster>
On Tue, Apr 27, 2021 at 10:25:31AM -0400, Brian Foster wrote:
> On Tue, Apr 27, 2021 at 09:13:18PM +0800, Gao Xiang wrote:
> > On Tue, Apr 27, 2021 at 08:46:25AM -0400, Brian Foster wrote:
> > > On Tue, Apr 27, 2021 at 09:12:01AM +0800, Gao Xiang wrote:
> > > > From: Dave Chinner <dchinner@redhat.com>
> > > >
> > > > Keep the mount superblock counters up to date for !lazysbcount
> > > > filesystems so that when we log the superblock they do not need
> > > > updating in any way because they are already correct.
> > > >
> > > > It's found by what Zorro reported:
> > > > 1. mkfs.xfs -f -l lazy-count=0 -m crc=0 $dev
> > > > 2. mount $dev $mnt
> > > > 3. fsstress -d $mnt -p 100 -n 1000 (maybe need more or less io load)
> > > > 4. umount $mnt
> > > > 5. xfs_repair -n $dev
> > > > and I've seen no problem with this patch.
> > > >
> > > > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > > > Reported-by: Zorro Lang <zlang@redhat.com>
> > > > Reviewed-by: Gao Xiang <hsiangkao@redhat.com>
> > > > Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
> > > > ---
> > >
> > > Could you provide a bit more detail on the problem in the commit log?
> > > From the description and code change, it seems like there is some
> > > problem with doing the percpu aggregation in xfs_log_sb() on
> > > !lazysbcount filesystems. Therefore this patch reserves that behavior
> > > for lazysbcount, and instead enables per-transaction updates in the
> > > !lazysbcount specific cleanup path. Am I following that correctly?
> >
> > This patch inherited from Dave's patch [1] (and I added reproduable
> > steps),
> > https://lore.kernel.org/r/20210422014446.GZ63242@dread.disaster.area
> >
> > More details see my original patch v2:
> > https://lore.kernel.org/r/20210420110855.2961626-1-hsiangkao@redhat.com
> >
>
> Ok, thanks. So the bit about xfs_log_sb() is to avoid an incorrect
> overwrite of the in-core sb counters from the percpu counters on
> !lazysbcount. The xfs_trans_apply_sb_deltas() function already applies
> the transaction deltas to the on-disk superblock buffer, so the change
> to xfs_trans_unreserve_and_mod_sb() is basically to apply those same
> deltas to the in-core superblock so they are consistent in the
> !lazysbcount case... yes? If I'm following that correctly, this looks
> good to me:
Yeah, that's right :)
>
> Reviewed-by: Brian Foster <bfoster@redhat.com>
Thanks for the review!
Thanks,
Gao Xiang
>
> > Thanks,
> > Gao Xiang
> >
> > >
> > > Brian
prev parent reply other threads:[~2021-04-27 14:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-27 1:12 [PATCH] xfs: update superblock counters correctly for !lazysbcount Gao Xiang
2021-04-27 3:07 ` Darrick J. Wong
2021-04-27 3:15 ` Gao Xiang
2021-04-28 7:49 ` Zorro Lang
2021-04-27 12:46 ` Brian Foster
2021-04-27 13:13 ` Gao Xiang
2021-04-27 14:25 ` Brian Foster
2021-04-27 14:30 ` Gao Xiang [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=20210427143007.GC103178@xiangao.remote.csb \
--to=hsiangkao@redhat.com \
--cc=bfoster@redhat.com \
--cc=dchinner@redhat.com \
--cc=djwong@kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=zlang@redhat.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