linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Yi Zhang <yi.zhang@redhat.com>,
	linux-block <linux-block@vger.kernel.org>,
	Bruno Goncalves <bgoncalv@redhat.com>,
	skt-results-master@redhat.com, Christoph Hellwig <hch@lst.de>
Subject: Re: [bug report][bisected] WARNING: CPU: 109 PID: 739473 at block/blk-stat.c:218 blk_free_queue_stats+0x3c/0x80
Date: Tue, 26 Oct 2021 10:35:53 +0200	[thread overview]
Message-ID: <20211026083553.GB4494@lst.de> (raw)
In-Reply-To: <9350ac53-84c0-b102-16ba-68fee6bcdbca@kernel.dk>

Hi Yi,

can you try the patch below?  This changes the teardown code to not
re-enable writeback tracking when we're shutting the queue down, which
is what I suspect is on the ->callbacks list.

diff --git a/block/elevator.c b/block/elevator.c
index ff45d8388f487..bb5c6ee4546cd 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -523,8 +523,6 @@ void elv_unregister_queue(struct request_queue *q)
 		kobject_del(&e->kobj);
 
 		e->registered = 0;
-		/* Re-enable throttling in case elevator disabled it */
-		wbt_enable_default(q);
 	}
 }
 
@@ -591,8 +589,11 @@ int elevator_switch_mq(struct request_queue *q,
 	lockdep_assert_held(&q->sysfs_lock);
 
 	if (q->elevator) {
-		if (q->elevator->registered)
+		if (q->elevator->registered) {
 			elv_unregister_queue(q);
+			/* Re-enable throttling in case elevator disabled it */
+			wbt_enable_default(q);
+		}
 
 		ioc_clear_queue(q);
 		elevator_exit(q, q->elevator);

  reply	other threads:[~2021-10-26  8:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19  4:13 [bug report] WARNING: CPU: 109 PID: 739473 at block/blk-stat.c:218 blk_free_queue_stats+0x3c/0x80 Yi Zhang
2021-10-22  5:29 ` Yi Zhang
2021-10-25 11:02   ` [bug report][bisected] " Yi Zhang
2021-10-25 14:02     ` Jens Axboe
2021-10-26  8:35       ` Christoph Hellwig [this message]
2021-10-26 10:06         ` Yi Zhang
2021-10-26  1:15 ` [bug report] " Ming Lei
2021-10-26 10:10   ` Yi Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211026083553.GB4494@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=bgoncalv@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=skt-results-master@redhat.com \
    --cc=yi.zhang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).