• NeilBrown's avatar
    SUNRPC/xprt: async tasks mustn't block waiting for memory · a7210354
    NeilBrown authored
    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.
    
    xprt_dynamic_alloc_slot can block indefinitely.  This can tie up all
    workqueue threads and NFS can deadlock.  So when called from a
    workqueue, set __GFP_NORETRY.
    
    The rdma alloc_slot already does not block.  However it sets the error
    to -EAGAIN suggesting this will trigger a sleep.  It does not.  As we
    can see in call_reserveresult(), only -ENOMEM causes a sleep.  -EAGAIN
    causes immediate retry.
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
    a7210354
transport.c 21.8 KB