diff mbox series

[v3,-next,1/2] blk-cgroup: don't call blk_mq_freeze_queue() in blkcg_deactivate_policy()

Message ID 20211019024132.432458-2-yukuai3@huawei.com (mailing list archive)
State New, archived
Headers show
Series blk-cgroup: synchoronize blkg creation against policy deactivation | expand

Commit Message

Yu Kuai Oct. 19, 2021, 2:41 a.m. UTC
blkcg_deactivate_policy() can be called from either
blk_cleanup_queue() for all policies or elevator_switch() for bfq
policy. Thus there is no need to freeze queue in
blkcg_deactivate_policy() since the caller freeze the queue aready.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 block/blk-cgroup.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Tejun Heo Oct. 19, 2021, 5 p.m. UTC | #1
Hello,

On Tue, Oct 19, 2021 at 10:41:31AM +0800, Yu Kuai wrote:
> blkcg_deactivate_policy() can be called from either
> blk_cleanup_queue() for all policies or elevator_switch() for bfq
> policy. Thus there is no need to freeze queue in
> blkcg_deactivate_policy() since the caller freeze the queue aready.
> 
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>

I would just keep the calls. The operation requires the q to be frozen and
there isn't a good way to annotate that the caller must be holding a usage
count, so it's useful even just as documentation.

Thanks.
diff mbox series

Patch

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index cec86a705c89..ca60233c8392 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1398,9 +1398,6 @@  void blkcg_deactivate_policy(struct request_queue *q,
 	if (!blkcg_policy_enabled(q, pol))
 		return;
 
-	if (queue_is_mq(q))
-		blk_mq_freeze_queue(q);
-
 	spin_lock_irq(&q->queue_lock);
 
 	__clear_bit(pol->plid, q->blkcg_pols);
@@ -1419,9 +1416,6 @@  void blkcg_deactivate_policy(struct request_queue *q,
 	}
 
 	spin_unlock_irq(&q->queue_lock);
-
-	if (queue_is_mq(q))
-		blk_mq_unfreeze_queue(q);
 }
 EXPORT_SYMBOL_GPL(blkcg_deactivate_policy);