From: Mark Tinguely <tinguely@sgi.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/2] xfs: move allocation stack switch up to xfs_bmapi_allocate
Date: Fri, 05 Oct 2012 08:28:36 -0500 [thread overview]
Message-ID: <506EE084.5070406@sgi.com> (raw)
In-Reply-To: <1349399219-13024-3-git-send-email-david@fromorbit.com>
On 10/04/12 20:06, Dave Chinner wrote:
> From: Dave Chinner<dchinner@redhat.com>
>
> Switching stacks are xfs_alloc_vextent can cause deadlocks when we
> run out of worker threads on the allocation workqueue. This can
> occur because xfs_bmap_btalloc can make multiple calls to
> xfs_alloc_vextent() and even if xfs_alloc_vextent() fails it can
> return with the AGF locked in the current allocation transaction.
>
> If we then need to make another allocation, and all the allocation
> worker contexts are exhausted because the are blocked waiting for
> the AGF lock, holder of the AGF cannot get it's xfs-alloc_vextent
> work completed to release the AGF. Hence allocation effectively
> deadlocks.
>
> To avoid this, move the stack switch one layer up to
> xfs_bmapi_allocate() so that all of the allocation attempts in a
> single switched stack transaction occur in a single worker context.
> This avoids the problem of an allocation being blocked waiting for
> a worker thread whilst holding the AGF.
>
> Signed-off-by: Dave Chinner<dchinner@redhat.com>
Looks good.
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-10-05 13:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-05 1:06 [PATCH 0/2] xfs: fix AGF/alloc workqueue deadlock Dave Chinner
2012-10-05 1:06 ` [PATCH 1/2] xfs: introduce XFS_BMAPI_STACK_SWITCH Dave Chinner
2012-10-05 13:27 ` Mark Tinguely
2012-10-05 1:06 ` [PATCH 2/2] xfs: move allocation stack switch up to xfs_bmapi_allocate Dave Chinner
2012-10-05 13:28 ` Mark Tinguely [this message]
2012-10-18 22:51 ` [PATCH 0/2] xfs: fix AGF/alloc workqueue deadlock Ben Myers
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=506EE084.5070406@sgi.com \
--to=tinguely@sgi.com \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/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