linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <dwagner@suse.de>
To: linux-block@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-kernel@vger.kernel.org, Ming Lei <ming.lei@redhat.com>,
	Daniel Wagner <dwagner@suse.de>
Subject: [PATCH] blk-mq: Make running from the wrong CPU less scary
Date: Thu, 26 Nov 2020 10:51:52 +0100	[thread overview]
Message-ID: <20201126095152.19151-1-dwagner@suse.de> (raw)

The current warning looks aweful like a proper crash. This is
confusing. There is not much information to gained from the stack
trace anyway, let's drop it.

While at it print the cpumask as there might be additial helpful
information when debugging the sitation.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
Hi,

We got a report from a customer because he was concerned about the log
entries. As it turns out, it fooled me too to be honest. What do you
think about making it a bit less look-a-like a kernel oops?


 smpboot: Booting Node 0 Processor 12 APIC 0x26                                                
WARNING, didn't collect load info for all cpus, balancing is broken                            
 run queue from wrong CPU 0, hctx active                                                       
 CPU: 0 PID: 42300 Comm: kworker/13:2H Kdump: loaded Tainted: G           OE  X    5.3.18-109.$
 Hardware name: IBM System x3650 M5 -[5462AC1]-/00KG915, BIOS -[TCE144J-3.11]- 12/03/2019      
 Workqueue: kblockd blk_mq_run_work_fn                                                         
 Call Trace:                                                                                   
  dump_stack+0x66/0x8b                                                                         
  __blk_mq_run_hw_queue+0xee/0x100                                                             
  process_one_work+0x1f4/0x3e0                                                                 
  worker_thread+0x2d/0x3e0                                                                     
  ? process_one_work+0x3e0/0x3e0                                                               
  kthread+0x10d/0x130                                                                          
  ? kthread_park+0xa0/0xa0                                                                     
  ret_from_fork+0x35/0x40                                                                      
 run queue from wrong CPU 0, hctx active                                                       
 CPU: 0 PID: 42300 Comm: kworker/13:2H Kdump: loaded Tainted: G           OE  X    5.3.18-109.$
 Hardware name: IBM System x3650 M5 -[5462AC1]-/00KG915, BIOS -[TCE144J-3.11]- 12/03/2019      
 Workqueue: kblockd blk_mq_run_work_fn    


Thanks,
Daniel

 block/blk-mq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 55bcee5dc032..0427b719d9c4 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1514,10 +1514,8 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
 	 */
 	if (!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) &&
 		cpu_online(hctx->next_cpu)) {
-		printk(KERN_WARNING "run queue from wrong CPU %d, hctx %s\n",
-			raw_smp_processor_id(),
-			cpumask_empty(hctx->cpumask) ? "inactive": "active");
-		dump_stack();
+		printk(KERN_WARNING "run queue from wrong CPU %d, hctx %*pbl\n",
+			raw_smp_processor_id(), cpumask_pr_args(hctx->cpumask));
 	}
 
 	/*
-- 
2.16.4


             reply	other threads:[~2020-11-26  9:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26  9:51 Daniel Wagner [this message]
2020-11-27  2:40 ` [PATCH] blk-mq: Make running from the wrong CPU less scary Ming Lei

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=20201126095152.19151-1-dwagner@suse.de \
    --to=dwagner@suse.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@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).