linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: Revert "let blkcg_gq grab request queue's refcnt"
@ 2023-01-30 23:22 Bart Van Assche
  2023-01-31  1:52 ` Ming Lei
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Van Assche @ 2023-01-30 23:22 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Bart Van Assche, Ming Lei, Christoph Hellwig

Since commit 0a9a25ca7843 ("block: let blkcg_gq grab request queue's
refcnt") for many request queues the reference count drops to 1 when
the request queue is destroyed instead of to 0. In other words, the
request queue is leaked. Fix this by reverting that commit.

This leak was discovered by running the following shell command before
and after the sub-page block layer tests:

cat /sys/kernel/debug/block/sub_page_limit_queues

Without this patch, the above debugfs attribute is increased by one
after each such sub-page block layer test. With this revert applied,
that debugfs attribute drops to zero after each sub-page block layer
test.

Cc: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/blk-cgroup.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index cb110fc51940..2e531268f725 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -141,7 +141,6 @@ static void blkg_free_workfn(struct work_struct *work)
 	if (q) {
 		list_del_init(&blkg->q_node);
 		mutex_unlock(&q->blkcg_mutex);
-		blk_put_queue(q);
 	}
 
 	free_percpu(blkg->iostat_cpu);
@@ -273,9 +272,6 @@ static struct blkcg_gq *blkg_alloc(struct blkcg *blkcg, struct gendisk *disk,
 	if (!blkg->iostat_cpu)
 		goto err_free;
 
-	if (!blk_get_queue(disk->queue))
-		goto err_free;
-
 	blkg->q = disk->queue;
 	INIT_LIST_HEAD(&blkg->q_node);
 	spin_lock_init(&blkg->async_bio_lock);

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

end of thread, other threads:[~2023-02-01 20:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-30 23:22 [PATCH] block: Revert "let blkcg_gq grab request queue's refcnt" Bart Van Assche
2023-01-31  1:52 ` Ming Lei
2023-01-31 17:31   ` Bart Van Assche
2023-02-01  1:56     ` Ming Lei
2023-02-01  4:29       ` Ming Lei
2023-02-01 15:55         ` Ming Lei
2023-02-01 20:21           ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).