From: "Darrick J. Wong" <djwong@kernel.org>
To: Sasha Levin <sashal@kernel.org>
Cc: stable@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
xfs-stable <xfs-stable@lists.linux.dev>
Subject: Re: [PATCH 6.12.y] xfs: use deferred intent items for reaping crosslinked blocks
Date: Mon, 20 Oct 2025 11:47:19 -0700 [thread overview]
Message-ID: <20251020184719.GQ6178@frogsfrogsfrogs> (raw)
In-Reply-To: <20251020154951.1825215-1-sashal@kernel.org>
On Mon, Oct 20, 2025 at 11:49:51AM -0400, Sasha Levin wrote:
> From: "Darrick J. Wong" <djwong@kernel.org>
>
> [ Upstream commit cd32a0c0dcdf634f2e0e71f41c272e19dece6264 ]
>
> When we're removing rmap records for crosslinked blocks, use deferred
> intent items so that we can try to free/unmap as many of the old data
> structure's blocks as we can in the same transaction as the commit.
>
> Cc: <stable@vger.kernel.org> # v6.6
> Fixes: 1c7ce115e52106 ("xfs: reap large AG metadata extents when possible")
> Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> [ adapted xfs_refcount_free_cow_extent() and xfs_rmap_free_extent() ]
> Signed-off-by: Sasha Levin <sashal@kernel.org>
Looks good to me,
Acked-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/xfs/scrub/reap.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/fs/xfs/scrub/reap.c b/fs/xfs/scrub/reap.c
> index 53697f3c5e1b0..8688edec58755 100644
> --- a/fs/xfs/scrub/reap.c
> +++ b/fs/xfs/scrub/reap.c
> @@ -409,8 +409,6 @@ xreap_agextent_iter(
> if (crosslinked) {
> trace_xreap_dispose_unmap_extent(sc->sa.pag, agbno, *aglenp);
>
> - rs->force_roll = true;
> -
> if (rs->oinfo == &XFS_RMAP_OINFO_COW) {
> /*
> * If we're unmapping CoW staging extents, remove the
> @@ -418,11 +416,14 @@ xreap_agextent_iter(
> * rmap record as well.
> */
> xfs_refcount_free_cow_extent(sc->tp, fsbno, *aglenp);
> + rs->force_roll = true;
> return 0;
> }
>
> - return xfs_rmap_free(sc->tp, sc->sa.agf_bp, sc->sa.pag, agbno,
> - *aglenp, rs->oinfo);
> + xfs_rmap_free_extent(sc->tp, sc->sa.pag->pag_agno, agbno,
> + *aglenp, rs->oinfo->oi_owner);
> + rs->deferred++;
> + return 0;
> }
>
> trace_xreap_dispose_free_extent(sc->sa.pag, agbno, *aglenp);
> --
> 2.51.0
>
prev parent reply other threads:[~2025-10-20 18:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 13:02 FAILED: patch "[PATCH] xfs: use deferred intent items for reaping crosslinked blocks" failed to apply to 6.12-stable tree gregkh
2025-10-20 15:49 ` [PATCH 6.12.y] xfs: use deferred intent items for reaping crosslinked blocks Sasha Levin
2025-10-20 18:47 ` Darrick J. Wong [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=20251020184719.GQ6178@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=hch@lst.de \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=xfs-stable@lists.linux.dev \
/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