Skip to content

Commit 946b81d

Browse files
Jiang Biaoaxboe
authored andcommitted
blkcg: don't hold blkcg lock when deactivating policy
As described in the comment of blkcg_activate_policy(), *Update of each blkg is protected by both queue and blkcg locks so that holding either lock and testing blkcg_policy_enabled() is always enough for dereferencing policy data.* with queue lock held, there is no need to hold blkcg lock in blkcg_deactivate_policy(). Similar case is in blkcg_activate_policy(), which has removed holding of blkcg lock in commit 4c55f4f. Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn> Signed-off-by: Wen Yang <wen.yang99@zte.com.cn> CC: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 0ce9144 commit 946b81d

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

block/blk-cgroup.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,9 +1410,6 @@ void blkcg_deactivate_policy(struct request_queue *q,
14101410
__clear_bit(pol->plid, q->blkcg_pols);
14111411

14121412
list_for_each_entry(blkg, &q->blkg_list, q_node) {
1413-
/* grab blkcg lock too while removing @pd from @blkg */
1414-
spin_lock(&blkg->blkcg->lock);
1415-
14161413
if (blkg->pd[pol->plid]) {
14171414
if (!blkg->pd[pol->plid]->offline &&
14181415
pol->pd_offline_fn) {
@@ -1422,8 +1419,6 @@ void blkcg_deactivate_policy(struct request_queue *q,
14221419
pol->pd_free_fn(blkg->pd[pol->plid]);
14231420
blkg->pd[pol->plid] = NULL;
14241421
}
1425-
1426-
spin_unlock(&blkg->blkcg->lock);
14271422
}
14281423

14291424
spin_unlock_irq(q->queue_lock);

0 commit comments

Comments
 (0)