Merge tag 'scrub-drain-intents-6.4_2023-04-11' of git://git.kernel.org/pub/scm/linux...
authorDave Chinner <david@fromorbit.com>
Thu, 13 Apr 2023 21:09:09 +0000 (07:09 +1000)
committerDave Chinner <dchinner@redhat.com>
Thu, 13 Apr 2023 21:09:09 +0000 (07:09 +1000)
commitb634abac59acc0e4397c5cf420278b32a6e0b69e
tree95193bc32cf9a2d8b595f256d568d6e48e0222d3
parent793f5c2cca10d0f33d38563c142ee00942c3e21e
parent88accf17226733088923635b580779a3c86b6f23
Merge tag 'scrub-drain-intents-6.4_2023-04-11' of git://git./linux/kernel/git/djwong/xfs-linux into guilt/xfs-for-next

xfs: drain deferred work items when scrubbing [v24.5]

The design doc for XFS online fsck contains a long discussion of the
eventual consistency models in use for XFS metadata.  In that chapter,
we note that it is possible for scrub to collide with a chain of
deferred space metadata updates, and proposes a lightweight solution:
The use of a pending-intents counter so that scrub can wait for the
system to drain all chains.

This patchset implements that scrub drain.  The first patch implements
the basic mechanism, and the subsequent patches reduce the runtime
overhead by converting the implementation to use sloppy counters and
introducing jump labels to avoid walking into scrub hooks when it isn't
running.  This last paradigm repeats elsewhere in this megaseries.

v23.1: make intent items take an active ref to the perag structure and
       document why we bump and drop the intent counts when we do

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>