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@xxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxx>