From: Li Xi Date: Wed, 8 Oct 2014 12:11:37 +0000 (+0800) Subject: LU-5717 ptlrpc: fix deadlock problem of nrs_tbf_timer_cb X-Git-Tag: 2.7.65~10 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F12228%2F5;p=fs%2Flustre-release.git LU-5717 ptlrpc: fix deadlock problem of nrs_tbf_timer_cb When callback of TBF timer is triggered, nrs_lock could be held by the current CPU which will cause dead lock. This patch removes unnecessary nrs_lock to fix this problem. Signed-off-by: Li Xi Change-Id: I6329e3e71da30a415dbb35b37d79ade118917c6a Reviewed-on: http://review.whamcloud.com/12228 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Emoly Liu --- diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c index d175468..1162c6f 100644 --- a/lustre/ptlrpc/nrs_tbf.c +++ b/lustre/ptlrpc/nrs_tbf.c @@ -73,9 +73,7 @@ static enum hrtimer_restart nrs_tbf_timer_cb(struct hrtimer *timer) struct ptlrpc_nrs *nrs = head->th_res.res_policy->pol_nrs; struct ptlrpc_service_part *svcpt = nrs->nrs_svcpt; - spin_lock(&nrs->nrs_lock); nrs->nrs_throttling = 0; - spin_unlock(&nrs->nrs_lock); wake_up(&svcpt->scp_waitq); return HRTIMER_NORESTART; @@ -1427,9 +1425,7 @@ struct ptlrpc_nrs_request *nrs_tbf_req_get(struct ptlrpc_nrs_policy *policy, } else { ktime_t time; - spin_lock(&policy->pol_nrs->nrs_lock); policy->pol_nrs->nrs_throttling = 1; - spin_unlock(&policy->pol_nrs->nrs_lock); head->th_deadline = deadline; time = ktime_set(0, 0); time = ktime_add_ns(time, deadline);