diff options
author | NeilBrown <neilb@suse.de> | 2022-03-07 02:41:44 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-13 21:59:12 +0300 |
commit | a19fd1d61797e0a0408537ecb97c57dd70c0045e (patch) | |
tree | e947426b05b9574bc94771251c56bb4f5880985e /lib/logic_pio.c | |
parent | b07387c476a350b74f1bcb8efc9b4c84e47e7a91 (diff) | |
download | linux-a19fd1d61797e0a0408537ecb97c57dd70c0045e.tar.xz |
SUNRPC/call_alloc: async tasks mustn't block waiting for memory
[ Upstream commit c487216bec83b0c5a8803e5c61433d33ad7b104d ]
When memory is short, new worker threads cannot be created and we depend
on the minimum one rpciod thread to be able to handle everything.
So it must not block waiting for memory.
mempools are particularly a problem as memory can only be released back
to the mempool by an async rpc task running. If all available
workqueue threads are waiting on the mempool, no thread is available to
return anything.
rpc_malloc() can block, and this might cause deadlocks.
So check RPC_IS_ASYNC(), rather than RPC_IS_SWAPPER() to determine if
blocking is acceptable.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/logic_pio.c')
0 files changed, 0 insertions, 0 deletions