Commit cb24e35b authored by J. Bruce Fields's avatar J. Bruce Fields Committed by Anna Schumaker

sunrpc: convert unnecessary GFP_ATOMIC to GFP_NOFS

It's OK to sleep here, we just don't want to recurse into the filesystem
as a writeout could be waiting on this.

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?
Reported-by: default avatarTrond Myklebust <trondmy@hammer.space>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 81c88b18
...@@ -752,7 +752,7 @@ void rpcb_getport_async(struct rpc_task *task) ...@@ -752,7 +752,7 @@ void rpcb_getport_async(struct rpc_task *task)
goto bailout_nofree; goto bailout_nofree;
} }
map = kzalloc(sizeof(struct rpcbind_args), GFP_ATOMIC); map = kzalloc(sizeof(struct rpcbind_args), GFP_NOFS);
if (!map) { if (!map) {
status = -ENOMEM; status = -ENOMEM;
dprintk("RPC: %5u %s: no memory available\n", dprintk("RPC: %5u %s: no memory available\n",
...@@ -770,7 +770,7 @@ void rpcb_getport_async(struct rpc_task *task) ...@@ -770,7 +770,7 @@ void rpcb_getport_async(struct rpc_task *task)
case RPCBVERS_4: case RPCBVERS_4:
case RPCBVERS_3: case RPCBVERS_3:
map->r_netid = xprt->address_strings[RPC_DISPLAY_NETID]; map->r_netid = xprt->address_strings[RPC_DISPLAY_NETID];
map->r_addr = rpc_sockaddr2uaddr(sap, GFP_ATOMIC); map->r_addr = rpc_sockaddr2uaddr(sap, GFP_NOFS);
if (!map->r_addr) { if (!map->r_addr) {
status = -ENOMEM; status = -ENOMEM;
dprintk("RPC: %5u %s: no memory available\n", dprintk("RPC: %5u %s: no memory available\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment