From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com
Subject: Re: [PATCH 1/3] xfs: change the order in which child and parent defer ops are finished
Date: Thu, 17 Sep 2020 15:57:57 +1000 [thread overview]
Message-ID: <20200917055757.GG12131@dread.disaster.area> (raw)
In-Reply-To: <160031339354.3624707.1985288778723932783.stgit@magnolia>
On Wed, Sep 16, 2020 at 08:29:53PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> The defer ops code has been finishing items in the wrong order -- if a
<snip long explanation>
Yeah, I'd kinda come to the same conclusion while reviewing the
recovery process. The analogy I made in my mind was the difference
in overhead of tracking a breadth-first tree walk vs a depth-first
tree walk...
> As originally written, the code used list_splice_tail_init instead of
> list_splice_init, so change that, and leave a short comment explaining
> our actions.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> fs/xfs/libxfs/xfs_defer.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
> index 97523b394932..84a70edd0da1 100644
> --- a/fs/xfs/libxfs/xfs_defer.c
> +++ b/fs/xfs/libxfs/xfs_defer.c
> @@ -431,8 +431,17 @@ xfs_defer_finish_noroll(
>
> /* Until we run out of pending work to finish... */
> while (!list_empty(&dop_pending) || !list_empty(&(*tp)->t_dfops)) {
> + /*
> + * Deferred items that are created in the process of finishing
> + * other deferred work items should be queued at the head of
> + * the pending list, which puts them ahead of the deferred work
> + * that was created by the caller. This keeps the number of
> + * pending work items to a minimum, which decreases the amount
> + * of time that any one intent item can stick around in memory,
> + * pinning the log tail.
> + */
> xfs_defer_create_intents(*tp);
> - list_splice_tail_init(&(*tp)->t_dfops, &dop_pending);
> + list_splice_init(&(*tp)->t_dfops, &dop_pending);
*nod*.
My favourite sort of fix - a couple of hundred lines of explanation
for a one-liner :)
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2020-09-17 5:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-17 3:29 [PATCH 0/3] xfs: fix some log stalling problems in defer ops Darrick J. Wong
2020-09-17 3:29 ` [PATCH 1/3] xfs: change the order in which child and parent defer ops are finished Darrick J. Wong
2020-09-17 5:57 ` Dave Chinner [this message]
2020-09-17 15:27 ` Brian Foster
2020-09-17 16:38 ` Darrick J. Wong
2020-09-17 3:30 ` [PATCH 2/3] xfs: periodically relog deferred intent items Darrick J. Wong
2020-09-17 6:11 ` Dave Chinner
2020-09-17 7:18 ` Darrick J. Wong
2020-09-17 15:28 ` Brian Foster
2020-09-18 0:36 ` Darrick J. Wong
2020-09-17 3:30 ` [PATCH 3/3] xfs: use the log grant push threshold to decide if we're going to relog deferred items Darrick J. Wong
2020-09-17 15:28 ` Brian Foster
2020-09-22 15:51 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2020-09-23 5:32 [PATCH v3 0/3] xfs: fix some log stalling problems in defer ops Darrick J. Wong
2020-09-23 5:33 ` [PATCH 1/3] xfs: change the order in which child and parent defer ops are finished 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=20200917055757.GG12131@dread.disaster.area \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=darrick.wong@oracle.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