All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blkcg: not hold blkcg lock when deactivating policy.
@ 2018-04-17  7:10 Jiang Biao
  2018-04-17 12:32   ` Paolo Valente
  0 siblings, 1 reply; 10+ messages in thread
From: Jiang Biao @ 2018-04-17  7:10 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, tj, jiang.biao2, zhong.weidong,
	wen.yang99

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 4c55f4f9ad3001ac1fefdd8d8ca7641d18558e23.

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>
CC: Jens Axboe <axboe@kernel.dk>
---
 block/blk-cgroup.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index c2033a2..2b7f8d0 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1367,17 +1367,12 @@ void blkcg_deactivate_policy(struct request_queue *q,
 	__clear_bit(pol->plid, q->blkcg_pols);
 
 	list_for_each_entry(blkg, &q->blkg_list, q_node) {
-		/* grab blkcg lock too while removing @pd from @blkg */
-		spin_lock(&blkg->blkcg->lock);
-
 		if (blkg->pd[pol->plid]) {
 			if (pol->pd_offline_fn)
 				pol->pd_offline_fn(blkg->pd[pol->plid]);
 			pol->pd_free_fn(blkg->pd[pol->plid]);
 			blkg->pd[pol->plid] = NULL;
 		}
-
-		spin_unlock(&blkg->blkcg->lock);
 	}
 
 	spin_unlock_irq(q->queue_lock);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-19  2:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-17  7:10 [PATCH] blkcg: not hold blkcg lock when deactivating policy Jiang Biao
2018-04-17 12:32 ` Paolo Valente
2018-04-17 12:32   ` Paolo Valente
2018-04-18  9:18   ` jiang.biao2
2018-04-18 12:45     ` Paolo Valente
2018-04-18 12:45       ` Paolo Valente
2018-04-18 14:40     ` Jens Axboe
2018-04-19  0:54       ` jiang.biao2
2018-04-19  2:09         ` Jens Axboe
2018-04-19  2:37           ` jiang.biao2

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.