Re: [PATCH 2/3] xfs: allow scrubbers to pause background reclaim

Darrick J. Wong
2019-04-18T01:15:47Z

On Thu, Apr 18, 2019 at 07:52:28AM +1000, Dave Chinner wrote:
> On Tue, Apr 16, 2019 at 06:40:12PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > The forthcoming summary counter patch races with regular filesystem
> > activity to compute rough expected values for the counters. This design
> > was chosen to avoid having to freeze the entire filesystem to check the
> > counters, but while that's running we'd prefer to minimize background
> > reclamation activity to reduce the perturbations to the incore free
> > block count. Therefore, provide a way for scrubbers to disable
> > background posteof and cowblock reclamation.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > fs/xfs/scrub/common.c | 18 ++++++++++++++++++
> > fs/xfs/scrub/common.h | 2 ++
> > fs/xfs/scrub/scrub.c | 2 ++
> > fs/xfs/scrub/scrub.h | 1 +
> > 4 files changed, 23 insertions(+)
> >
> >
> > diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
> > index 7076d5c98151..a406a22a734f 100644
> > --- a/fs/xfs/scrub/common.c
> > +++ b/fs/xfs/scrub/common.c
> > @@ -894,3 +894,21 @@ xchk_ilock_inverted(
> > }
> > return -EDEADLOCK;
> > }
> > +
> > +/* Pause background reclamation and inactivation. */
> > +void
> > +xchk_disable_reclaim(
> > + struct xfs_scrub *sc)
> > +{
> > + sc->flags |= XCHK_RECLAIM_DISABLED;
> > + xfs_icache_disable_reclaim(sc->mp);
> > +}
>
> Hmmm. Poorly named function. "reclaim" in the context of
> xfs_icache.c means inode cache reclaim...
>
> We're not actually disabling inode reclaim here, we
> are disabling background block reaping.
>
> Can we change this all to be named more appropriately (including the
> icache.c functions? Then it is all fine because I don't look at
> it and think "that'll break under memory pressure"....

Ah, reaping! That's the word I was looking for. :(

xfs_icache_disable_speculative_reaping
xchk_disable_speculative_reaping

Sort of a long name but eh not that many people will use it.

--D

> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com