Whamcloud - gitweb
LU-5717 ptlrpc: fix deadlock problem of nrs_tbf_timer_cb 28/12228/5
authorLi Xi <lixi@ddn.com>
Wed, 8 Oct 2014 12:11:37 +0000 (20:11 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 9 Jan 2016 00:05:31 +0000 (00:05 +0000)
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 <lixi@ddn.com>
Change-Id: I6329e3e71da30a415dbb35b37d79ade118917c6a
Reviewed-on: http://review.whamcloud.com/12228
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
lustre/ptlrpc/nrs_tbf.c

index d175468..1162c6f 100644 (file)
@@ -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);