From: Jeff Layton <jlayton@redhat.com>
To: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
Cc: "harshula@redhat.com" <harshula@redhat.com>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"mgorman@suse.de" <mgorman@suse.de>,
"jan.kratochvil@redhat.com" <jan.kratochvil@redhat.com>
Subject: Re: [RFC PATCH v2] nfs: skip commit in releasepage if we're freeing memory for fs-related reasons
Date: Tue, 3 Jul 2012 07:20:51 -0400 [thread overview]
Message-ID: <20120703072051.4e7a9d34@corrin.poochiereds.net> (raw)
In-Reply-To: <1341258017.8197.46.camel@lade.trondhjem.org>
On Mon, 2 Jul 2012 19:40:22 +0000
"Myklebust, Trond" <Trond.Myklebust@netapp.com> wrote:
> On Mon, 2012-07-02 at 11:17 -0400, Jeff Layton wrote:
> > nfs: broaden the cases where we use a non-blocking commit in releasepage
> >
> > Currently, we just do a non-blocking commit when called from kswapd, but
> > that still gives us some cases where we end up blocking after recursing
> > back into the filesystem. Instead, turn that check into a check for
> > PF_MEMALLOC so that we never block when trying to free memory in order to
> > satisfy an allocation.
> >
> > Signed-off-by: Jeff Layton <jlayton@redhat.com>
> > ---
> > fs/nfs/file.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/nfs/file.c b/fs/nfs/file.c
> > index 9075769..61d3670 100644
> > --- a/fs/nfs/file.c
> > +++ b/fs/nfs/file.c
> > @@ -466,8 +466,8 @@ static int nfs_release_page(struct page *page, gfp_t gfp)
> > !(current->flags & PF_FSTRANS)) {
> > int how = FLUSH_SYNC;
> >
> > - /* Don't let kswapd deadlock waiting for OOM RPC calls */
> > - if (current_is_kswapd())
> > + /* Don't block if we're freeing for a memory allocation */
> > + if (current->flags & PF_MEMALLOC)
> > how = 0;
> > nfs_commit_inode(mapping->host, how);
> > }
>
> Umm... So which process will actually call nfs_release_page() with
> GFP_KERNEL, but without the PF_MEMALLOC flag being set?
>
Well...there are a number of callers of try_to_release_page with
GFP_KERNEL that are not involved with reclaim:
The migrate_page codepaths and the splice code, for instance. Also
invalidate_complete_page2, which we call when invalidating an inode and
maybe also when truncating? Those are almost certainly less traveled
than the reclaim codepaths though.
--
Jeff Layton <jlayton@redhat.com>
prev parent reply other threads:[~2012-07-03 11:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-15 12:54 rpciod process is blocked in nfs_release_page waiting for nfs_commit_inode to complete Harshula
2012-06-15 13:21 ` Jeff Layton
2012-06-15 21:25 ` Myklebust, Trond
2012-06-20 14:14 ` Jeff Layton
2012-06-28 14:31 ` Mel Gorman
2012-06-28 14:55 ` Jeff Layton
2012-06-27 15:54 ` Jeff Layton
2012-06-27 18:43 ` Myklebust, Trond
2012-06-27 19:28 ` Jeff Layton
2012-06-27 19:37 ` Myklebust, Trond
2012-06-27 20:18 ` Jeff Layton
2012-06-27 19:56 ` Myklebust, Trond
2012-06-27 20:19 ` Jeff Layton
2012-06-27 20:46 ` Myklebust, Trond
2012-06-28 13:19 ` Jeff Layton
2012-06-28 13:40 ` Myklebust, Trond
2012-06-28 14:47 ` Jeff Layton
2012-06-28 14:51 ` [RFC PATCH] nfs: do non-blocking commit in releasepage if we're attempting to reconnect the socket Jeff Layton
2012-06-28 15:02 ` Myklebust, Trond
2012-06-28 15:25 ` [RFC PATCH v2] nfs: skip commit in releasepage if we're freeing memory for fs-related reasons Jeff Layton
2012-07-02 15:17 ` Jeff Layton
2012-07-02 19:40 ` Myklebust, Trond
2012-07-03 11:20 ` Jeff Layton [this message]
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=20120703072051.4e7a9d34@corrin.poochiereds.net \
--to=jlayton@redhat.com \
--cc=Trond.Myklebust@netapp.com \
--cc=harshula@redhat.com \
--cc=jan.kratochvil@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=mgorman@suse.de \
/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).