Skip to content

Commit 5563878

Browse files
hailan94kawasaki
authored andcommitted
blk-cgroup: remove queue frozen from blkcg_activate_policy()
On the one hand, nest q_usage_counter under rq_qos_mutex is wrong; On the other hand, policy activation is now all under queue frozen: - for bfq queue is frozen from elevator_change(); - for blk-throttle, iocost, iolatency, queue is frozen from blkg_conf_open_bdev_frozen(&ctx); Signed-off-by: Yu Kuai <[email protected]> Reviewed-by: Nilay Shroff <[email protected]>
1 parent 61f97e4 commit 5563878

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

block/blk-cgroup.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,12 +1580,13 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
15801580
struct request_queue *q = disk->queue;
15811581
struct blkg_policy_data *pd_prealloc = NULL;
15821582
struct blkcg_gq *blkg, *pinned_blkg = NULL;
1583-
unsigned int memflags;
15841583
int ret;
15851584

15861585
if (blkcg_policy_enabled(q, pol))
15871586
return 0;
15881587

1588+
WARN_ON_ONCE(q->mq_freeze_depth == 0);
1589+
15891590
/*
15901591
* Policy is allowed to be registered without pd_alloc_fn/pd_free_fn,
15911592
* for example, ioprio. Such policy will work on blkcg level, not disk
@@ -1594,8 +1595,6 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
15941595
if (WARN_ON_ONCE(!pol->pd_alloc_fn || !pol->pd_free_fn))
15951596
return -EINVAL;
15961597

1597-
if (queue_is_mq(q))
1598-
memflags = blk_mq_freeze_queue(q);
15991598
retry:
16001599
spin_lock_irq(&q->queue_lock);
16011600

@@ -1658,8 +1657,6 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
16581657

16591658
spin_unlock_irq(&q->queue_lock);
16601659
out:
1661-
if (queue_is_mq(q))
1662-
blk_mq_unfreeze_queue(q, memflags);
16631660
if (pinned_blkg)
16641661
blkg_put(pinned_blkg);
16651662
if (pd_prealloc)

0 commit comments

Comments
 (0)