On Thu, 2018-12-20 at 10:52 -0500, Bruce Fields wrote: > On Thu, Dec 20, 2018 at 10:47:25AM -0500, Chuck Lever wrote: > > > > > On Dec 20, 2018, at 10:42 AM, J. Bruce Fields < > > > bfields@xxxxxxxxxxxx> wrote: > > > > > > From: "J. Bruce Fields" <bfields@xxxxxxxxxx> > > > > > > It's OK to sleep here, we just don't want to recurse into the > > > filesystem > > > as this writeout could be waiting on this. > > > > "as a writeout" > > Oops, thanks. > > > > Future work: the documentation for GFP_NOFS says "Please try to > > > avoid > > > using this flag directly and instead use > > > memalloc_nofs_{save,restore} to > > > mark the whole scope which cannot/shouldn't recurse into the FS > > > layer > > > with a short explanation why. All allocation requests will > > > inherit > > > GFP_NOFS implicitly." > > > > > > But I'm not sure where to do this. Should the workqueue be > > > arranging > > > that for us in the case of workqueues created with > > > WQ_MEM_RECLAIM? > > > > There seem to be plenty of uses of GFP_NOFS in NFS and sunrpc. > > That sounds like a big project. > > Yeah, just noting it for future reference. > I'd suggest that we can probably just call memalloc_nofs_save() in rpc_execute(), and otherwise in those workqueue callback functions that are executed directly by rpciod and xprtiod. That doesn't make for too many callsites. -- Trond Myklebust Linux NFS client maintainer, Hammerspace trond.myklebust@xxxxxxxxxxxxxxx