From: Jeff Layton <jlayton@kernel.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
Chuck Lever III <chuck.lever@oracle.com>
Cc: Frank van der Linden <fllinden@amazon.com>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] nfsd: don't use GFP_KERNEL from nfsd_getxattr()/nfsd_listxattr()
Date: Sat, 15 Apr 2023 14:40:17 -0400 [thread overview]
Message-ID: <aee35d52ab19e7e95f69742be8329764db72cbf8.camel@kernel.org> (raw)
In-Reply-To: <b014047a-4a70-b38f-c5bb-01bc3c53d6f2@I-love.SAKURA.ne.jp>
On Sun, 2023-04-16 at 02:11 +0900, Tetsuo Handa wrote:
> On 2023/04/16 1:13, Chuck Lever III wrote:
> > > On Apr 15, 2023, at 7:07 AM, Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> wrote:
> > >
> > > Since GFP_KERNEL is GFP_NOFS | __GFP_FS, usage like GFP_KERNEL | GFP_NOFS
> > > does not make sense. Drop __GFP_FS flag in order to avoid deadlock.
> >
> > The server side threads run in process context. GFP_KERNEL
> > is safe to use here -- as Jeff said, this code is not in
> > the server's reclaim path. Plenty of other call sites in
> > the NFS server code use GFP_KERNEL.
>
> GFP_KERNEL memory allocation calls filesystem's shrinker functions
> because of __GFP_FS flag. My understanding is
>
> Whether this code is in memory reclaim path or not is irrelevant.
> Whether memory reclaim path might hold lock or not is relevant.
>
> . Therefore, question is, does nfsd hold i_rwsem during memory reclaim path?
>
No. At the time of these allocations, the i_rwsem is not held.
> >
> > But I agree that the flag combination doesn't make sense.
> > Maybe drop GFP_NOFS instead and call it only a clean-up?
>
Yeah, I think that's the right thing to do here.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2023-04-15 18:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-15 11:07 [PATCH] nfsd: don't use GFP_KERNEL from nfsd_getxattr()/nfsd_listxattr() Tetsuo Handa
2023-04-15 11:42 ` Jeff Layton
2023-04-15 16:13 ` Chuck Lever III
2023-04-15 17:11 ` Tetsuo Handa
2023-04-15 18:40 ` Jeff Layton [this message]
2023-04-15 23:21 ` Tetsuo Handa
2023-04-16 11:51 ` Jeff Layton
2023-04-16 16:20 ` Chuck Lever III
2023-04-16 23:37 ` Dave Chinner
2023-04-17 22:25 ` Frank van der Linden
2023-04-17 23:07 ` Frank van der Linden
2023-04-19 13:51 ` Chuck Lever III
2023-04-19 23:32 ` Dave Chinner
2023-04-20 13:41 ` Chuck Lever III
2023-04-20 14:05 ` Tetsuo Handa
2023-04-20 14:41 ` Chuck Lever III
2023-04-20 15:20 ` Jeff Layton
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=aee35d52ab19e7e95f69742be8329764db72cbf8.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=fllinden@amazon.com \
--cc=linux-nfs@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
/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