All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] NFS: Use GFP_NOFS in nfs_direct_req_alloc
Date: Tue, 8 Sep 2009 18:43:02 -0400	[thread overview]
Message-ID: <931F30AB-DC64-4A02-A96C-FABF0DD4059A@oracle.com> (raw)
In-Reply-To: <1252449178.8099.64.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>

On Sep 8, 2009, at 6:32 PM, Trond Myklebust wrote:
> On Tue, 2009-09-08 at 18:05 -0400, Chuck Lever wrote:
>> Don't dive into memory reclaim in the NFS direct I/O paths, otherwise
>> we can deadlock.
>>
>> Reported by: Wengang Wang <wen.gang.wang@oracle.com>
>> Fix-suggested-by: Zach Brown <zach.brown@oracle.com>
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>
> Wait... What??? How does an O_DIRECT read or write allocation deadlock
> with memory reclaim? Both the read and the write path call
> nfs_direct_req_alloc() before they pin any user pages in memory.

This may be an issue only for loopback mounts where the backing device  
is an NFS O_DIRECT file.  This type of deadlock may not be able to  
happen in upstream kernels at this point.

Even so, it makes sense for this allocation to be consistent with  
similar allocations in the other NFS I/O paths.

> Trond
>
>> ---
>>
>> Trond-
>>
>> Thoughts?
>>
>> fs/nfs/direct.c |    2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
>> index e4e089a..00f06b8 100644
>> --- a/fs/nfs/direct.c
>> +++ b/fs/nfs/direct.c
>> @@ -149,7 +149,7 @@ static inline struct nfs_direct_req  
>> *nfs_direct_req_alloc(void)
>> {
>> 	struct nfs_direct_req *dreq;
>>
>> -	dreq = kmem_cache_alloc(nfs_direct_cachep, GFP_KERNEL);
>> +	dreq = kmem_cache_alloc(nfs_direct_cachep, GFP_NOFS);
>> 	if (!dreq)
>> 		return NULL;
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux- 
>> nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> -- 
> Trond Myklebust
> Linux NFS client maintainer
>
> NetApp
> Trond.Myklebust@netapp.com
> www.netapp.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs"  
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




  parent reply	other threads:[~2009-09-08 22:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-08 22:05 [PATCH] NFS: Use GFP_NOFS in nfs_direct_req_alloc Chuck Lever
     [not found] ` <20090908220230.7590.69833.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2009-09-08 22:32   ` Trond Myklebust
     [not found]     ` <1252449178.8099.64.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-09-08 22:43       ` Chuck Lever [this message]
2009-09-08 23:05         ` Trond Myklebust
     [not found]           ` <1252451130.8099.81.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-09-09  1:01             ` Chuck Lever
2009-09-09  1:37               ` Trond Myklebust
     [not found]                 ` <1252460233.5092.12.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-09-09  2:16                   ` Chuck Lever
2009-09-09  3:49                     ` Trond Myklebust

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=931F30AB-DC64-4A02-A96C-FABF0DD4059A@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.