diff options
| author | Ming Lei <ming.lei@redhat.com> | 2023-11-17 10:35:24 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-12-20 15:17:39 +0100 |
| commit | 252c2a4795e9b7789d55a97943659d910c39987c (patch) | |
| tree | 6ca95c94f270249d3007e19158b8c0f5925fa4d3 | |
| parent | 8146f7a8809bf7e46ab2fb337d304eb7a8be56d3 (diff) | |
| download | linux-252c2a4795e9b7789d55a97943659d910c39987c.tar.gz linux-252c2a4795e9b7789d55a97943659d910c39987c.tar.bz2 linux-252c2a4795e9b7789d55a97943659d910c39987c.zip | |
blk-cgroup: bypass blkcg_deactivate_policy after destroying
[ Upstream commit e63a57303599b17290cd8bc48e6f20b24289a8bc ]
blkcg_deactivate_policy() can be called after blkg_destroy_all()
returns, and it isn't necessary since blkg_destroy_all has covered
policy deactivation.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20231117023527.3188627-4-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | block/blk-cgroup.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 3ee4c1217b63..fd81a7370864 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -425,6 +425,7 @@ static void blkg_destroy_all(struct request_queue *q) { struct blkcg_gq *blkg, *n; int count = BLKG_DESTROY_BATCH_SIZE; + int i; restart: spin_lock_irq(&q->queue_lock); @@ -447,6 +448,18 @@ restart: } } + /* + * Mark policy deactivated since policy offline has been done, and + * the free is scheduled, so future blkcg_deactivate_policy() can + * be bypassed + */ + for (i = 0; i < BLKCG_MAX_POLS; i++) { + struct blkcg_policy *pol = blkcg_policy[i]; + + if (pol) + __clear_bit(pol->plid, q->blkcg_pols); + } + q->root_blkg = NULL; spin_unlock_irq(&q->queue_lock); } |
