public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: xfs@oss.sgi.com
Cc: hch@infradead.org
Subject: Re: [RFC]xfs: using GFP_NOFS for blkdev_issue_flush
Date: Mon, 16 Apr 2012 14:58:21 +0800	[thread overview]
Message-ID: <4F8BC30D.5040601@kernel.org> (raw)
In-Reply-To: <4F8BC112.9090508@fusionio.com>

On 4/16/12 2:49 PM, Shaohua Li wrote:
>
> flush request is issued in transaction commit code path usually, so
> looks using
> GFP_KERNEL to allocate memory for flush request bio falls into the classic
> deadlock issue (memory reclaim recursion). Use GFP_NOFS to avoid recursion
> from reclaim context. Per Dave Chinner, there is only blkdev_issue_flush
> might
> be buggy here. But using GFP_NOFS by default for all calls should not
> matter.
>
> Signed-off-by: Shaohua Li <shli@fusionio.com>
> ---
> fs/xfs/xfs_super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux/fs/xfs/xfs_super.c
> ===================================================================
> --- linux.orig/fs/xfs/xfs_super.c 2012-04-13 10:08:26.095496072 +0800
> +++ linux/fs/xfs/xfs_super.c 2012-04-13 10:08:42.555496865 +0800
> @@ -622,7 +622,7 @@ void
> xfs_blkdev_issue_flush(
> xfs_buftarg_t *buftarg)
> {
> - blkdev_issue_flush(buftarg->bt_bdev, GFP_KERNEL, NULL);
> + blkdev_issue_flush(buftarg->bt_bdev, GFP_NOFS, NULL);
> }
>
> STATIC void
>
Oops, I apologize for the html mail, it slipped to wrong imap server. 
below one has correct format.

flush request is issued in transaction commit code path usually, so 
looks using
GFP_KERNEL to allocate memory for flush request bio falls into the classic
deadlock issue (memory reclaim recursion). Use GFP_NOFS to avoid recursion
from reclaim context. Per Dave Chinner, there is only blkdev_issue_flush 
might
be buggy here. But using GFP_NOFS by default for all calls should not 
matter.

Signed-off-by: Shaohua Li <shli@fusionio.com>
---
  fs/xfs/xfs_super.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/fs/xfs/xfs_super.c
===================================================================
--- linux.orig/fs/xfs/xfs_super.c	2012-04-13 10:08:26.095496072 +0800
+++ linux/fs/xfs/xfs_super.c	2012-04-13 10:08:42.555496865 +0800
@@ -622,7 +622,7 @@ void
  xfs_blkdev_issue_flush(
  	xfs_buftarg_t		*buftarg)
  {
-	blkdev_issue_flush(buftarg->bt_bdev, GFP_KERNEL, NULL);
+	blkdev_issue_flush(buftarg->bt_bdev, GFP_NOFS, NULL);
  }

  STATIC void

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2012-04-16  6:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16  6:49 [RFC]xfs: using GFP_NOFS for blkdev_issue_flush Shaohua Li
2012-04-16  6:58 ` Shaohua Li [this message]
2012-04-17 18:42   ` Mark Tinguely
2012-04-18  1:37   ` Dave Chinner
2012-04-24 13:23     ` Shaohua Li
2012-04-25  0:25       ` Dave Chinner

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=4F8BC30D.5040601@kernel.org \
    --to=shli@kernel.org \
    --cc=hch@infradead.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