From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2 3/6] xfs: defer agfl block frees from deferred ops processing context
Date: Mon, 7 May 2018 18:11:32 -0700 [thread overview]
Message-ID: <20180508011132.GG11261@magnolia> (raw)
In-Reply-To: <20180418133119.21775-4-bfoster@redhat.com>
On Wed, Apr 18, 2018 at 09:31:16AM -0400, Brian Foster wrote:
> Now that AGFL block frees are deferred when dfops is set in the
> transaction, start deferring AGFL block frees from contexts that are
> known to push the limits of existing log reservations.
>
> The first such context is deferred operation processing itself. This
> primarily targets deferred extent frees (such as file extents and
> inode chunks), but in doing so covers all allocation operations that
> occur in deferred operation processing context.
>
> Update xfs_defer_finish() to set and reset ->t_agfl_dfops across the
> processing sequence. This means that any AGFL block frees due to
> allocation events result in the addition of new EFIs to the dfops
> rather than being processed immediately. xfs_defer_finish() rolls
> the transaction at least once more to process the frees of the AGFL
> blocks back to the allocation btrees and returns once the AGFL is
> rectified.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
Looks ok, will test...
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/xfs/libxfs/xfs_defer.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
> index 087fea02c389..4d87d9661907 100644
> --- a/fs/xfs/libxfs/xfs_defer.c
> +++ b/fs/xfs/libxfs/xfs_defer.c
> @@ -352,11 +352,22 @@ xfs_defer_finish(
> void *state;
> int error = 0;
> void (*cleanup_fn)(struct xfs_trans *, void *, int);
> + struct xfs_defer_ops *orig_dop;
>
> ASSERT((*tp)->t_flags & XFS_TRANS_PERM_LOG_RES);
>
> trace_xfs_defer_finish((*tp)->t_mountp, dop);
>
> + /*
> + * Attach dfops to the transaction during deferred ops processing. This
> + * explicitly causes calls into the allocator to defer AGFL block frees.
> + * Note that this code can go away once all dfops users attach to the
> + * associated tp.
> + */
> + ASSERT(!(*tp)->t_agfl_dfops || ((*tp)->t_agfl_dfops == dop));
> + orig_dop = (*tp)->t_agfl_dfops;
> + (*tp)->t_agfl_dfops = dop;
> +
> /* Until we run out of pending work to finish... */
> while (xfs_defer_has_unfinished_work(dop)) {
> /* Log intents for work items sitting in the intake. */
> @@ -428,6 +439,7 @@ xfs_defer_finish(
> }
>
> out:
> + (*tp)->t_agfl_dfops = orig_dop;
> if (error)
> trace_xfs_defer_finish_error((*tp)->t_mountp, dop, error);
> else
> --
> 2.13.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-05-08 1:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-18 13:31 [PATCH v2 0/6] xfs: defer agfl block frees Brian Foster
2018-04-18 13:31 ` [PATCH v2 1/6] xfs: create agfl block free helper function Brian Foster
2018-05-08 0:35 ` Darrick J. Wong
2018-04-18 13:31 ` [PATCH v2 2/6] xfs: defer agfl block frees when dfops is available Brian Foster
2018-05-08 1:10 ` Darrick J. Wong
2018-05-08 12:31 ` Brian Foster
2018-05-08 18:04 ` Darrick J. Wong
2018-05-09 11:18 ` Brian Foster
2018-05-09 14:34 ` Darrick J. Wong
2018-05-09 15:41 ` Brian Foster
2018-05-09 15:56 ` Darrick J. Wong
2018-05-09 16:04 ` Darrick J. Wong
2018-05-09 16:31 ` Brian Foster
2018-04-18 13:31 ` [PATCH v2 3/6] xfs: defer agfl block frees from deferred ops processing context Brian Foster
2018-05-08 1:11 ` Darrick J. Wong [this message]
2018-04-18 13:31 ` [PATCH v2 4/6] xfs: defer agfl frees from inode inactivation Brian Foster
2018-04-18 13:31 ` [PATCH v2 5/6] xfs: defer frees from common inode allocation paths Brian Foster
2018-04-18 13:31 ` [PATCH v2 6/6] xfs: defer agfl frees from directory op transactions Brian Foster
2018-05-08 1:12 ` Darrick J. Wong
2018-05-08 12:33 ` Brian Foster
2018-05-08 14:53 ` Darrick J. Wong
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=20180508011132.GG11261@magnolia \
--to=darrick.wong@oracle.com \
--cc=bfoster@redhat.com \
--cc=linux-xfs@vger.kernel.org \
/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