X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fldlm%2Fldlm_lockd.c;h=b29b7214d1713ebbcdedc55e627d70b54808c8fc;hp=651eebe40e881b48c4f17abac5e631b9ff6e42fa;hb=c156613b29be6fcee13d0df7008f0cd7847a5263;hpb=2ffbcc9f9ad930fee2df53238b3244b7c3e6bb91 diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 651eebe..b29b721 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -2767,6 +2767,11 @@ static int ldlm_bl_thread_main(void *arg) if (rc == LDLM_ITER_STOP) break; + + /* If there are many namespaces, we will not sleep waiting for + * work, and must do a cond_resched to avoid holding the CPU + * for too long */ + cond_resched(); } atomic_dec(&blp->blp_num_threads);