• NeilBrown's avatar
    SUNRPC/auth: async tasks mustn't block waiting for memory · a41b05ed
    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.
    
    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.
    
    lookup_cred() can block on a mempool or kmalloc - and this can cause
    deadlocks.  So add a new RPCAUTH_LOOKUP flag for async lookups and don't
    block on memory.  If the -ENOMEM gets back to call_refreshresult(), wait
    a short while and try again.  HZ>>4 is chosen as it is used elsewhere
    for -ENOMEM retries.
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
    a41b05ed
auth_gss.c 55.9 KB