Re: [PATCH 10/16] xfs: convert extent busy tracking to the generic group structure

Dave Chinner
2024-10-15T01:09:00Z

On Thu, Oct 10, 2024 at 05:46:48PM -0700, Darrick J. Wong wrote:
> From: Christoph Hellwig <hch@lst.de>
>
> Prepare for tracking busy RT extents by passing the generic group
> structure to the xfs_extent_busy_class tracepoints.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
> fs/xfs/xfs_extent_busy.c | 12 +++++++-----
> fs/xfs/xfs_trace.h | 34 +++++++++++++++++++++-------------
> 2 files changed, 28 insertions(+), 18 deletions(-)

Subject is basically the same as the next patch - swap "busy"
and "extent" and they are the same. Perhaps this should be
called "Convert extent busy trace points to generic groups".

> diff --git a/fs/xfs/xfs_extent_busy.c b/fs/xfs/xfs_extent_busy.c
> index 2806fc6ab4800d..ff10307702f011 100644
> --- a/fs/xfs/xfs_extent_busy.c
> +++ b/fs/xfs/xfs_extent_busy.c
> @@ -41,7 +41,7 @@ xfs_extent_busy_insert_list(
> new->flags = flags;
>
> /* trace before insert to be able to see failed inserts */
> - trace_xfs_extent_busy(pag, bno, len);
> + trace_xfs_extent_busy(&pag->pag_group, bno, len);
>
> spin_lock(&pag->pagb_lock);
> rbp = &pag->pagb_tree.rb_node;
> @@ -278,13 +278,13 @@ xfs_extent_busy_update_extent(
> ASSERT(0);
> }
>
> - trace_xfs_extent_busy_reuse(pag, fbno, flen);
> + trace_xfs_extent_busy_reuse(&pag->pag_group, fbno, flen);
> return true;
>
> out_force_log:
> spin_unlock(&pag->pagb_lock);
> xfs_log_force(pag_mount(pag), XFS_LOG_SYNC);
> - trace_xfs_extent_busy_force(pag, fbno, flen);
> + trace_xfs_extent_busy_force(&pag->pag_group, fbno, flen);
> spin_lock(&pag->pagb_lock);
> return false;
> }
> @@ -496,7 +496,8 @@ xfs_extent_busy_trim(
> out:
>
> if (fbno != *bno || flen != *len) {
> - trace_xfs_extent_busy_trim(args->pag, *bno, *len, fbno, flen);
> + trace_xfs_extent_busy_trim(&args->pag->pag_group, *bno, *len,
> + fbno, flen);

Also, the more I see this sort of convert, the more I want to see a
pag_group(args->pag) helper to match with stuff like pag_mount() and
pag_agno()....

-Dave.
--
Dave Chinner
david@fromorbit.com