linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] bdi: mark the bdi flusher busy when being forked
Date: Wed, 13 Apr 2011 14:29:23 -0500	[thread overview]
Message-ID: <1302722963.2023.66.camel@doink> (raw)
In-Reply-To: <1302157196-1988-2-git-send-email-david@fromorbit.com>

On Thu, 2011-04-07 at 16:19 +1000, Dave Chinner wrote: 
> From: Dave Chinner <dchinner@redhat.com>
> 
> Recetn attempts to use writeback_inode_sb_nr_if_idle() in XFs from
> memory reclaim context have caused deadlocks because memory reclaim
> call be called from a failed allocation during forking a flusher
> thread. The shrinker then attempts to trigger writeback and the bdi
> is considered idle because writeback is not in progress yet and then
> deadlocks because bdi_queue_work() blocks waiting for the
> BDI_Pending bit to clear which will never happen because it needs
> the fork to complete.
> 
> To avoid this deadlock, consider writeback to be in progress if the
> flusher thread is being created. This prevents reclaim from blocking
> waiting for it be forked and hence avoids the deadlock.

I don't believe it matters, but BDI_pending is also set
while a writeback flusher thread is being shut down.

In any case, a handy use of that flag bit.

Reviewed-by: Alex Elder <aelder@sgi.com>

> Signed-off-by: Dave Chinner <dchinner@redhat.com>



  parent reply	other threads:[~2011-04-13 19:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07  6:19 [PATCH 0/2] xfs: write back inodes during reclaim Dave Chinner
2011-04-07  6:19 ` [PATCH 1/2] bdi: mark the bdi flusher busy when being forked Dave Chinner
2011-04-11 18:34   ` Christoph Hellwig
2011-04-13 19:29   ` Alex Elder [this message]
2011-04-07  6:19 ` [PATCH 2/2] xfs: kick inode writeback when low on memory Dave Chinner
2011-04-11 18:36   ` Christoph Hellwig
2011-04-11 21:14     ` Dave Chinner
2011-04-13 20:33   ` Alex Elder
2011-04-14  5:08     ` Dave Chinner
2011-04-15  8:09       ` Christoph Hellwig

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=1302722963.2023.66.camel@doink \
    --to=aelder@sgi.com \
    --cc=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).