aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2016-08-24 17:38:01 -0400
committerJens Axboe <axboe@fb.com>2016-08-24 17:38:01 -0400
commit0e87e58bf60edb6bb28e493c7a143f41b091a5e5 (patch)
treef7da272dc09742028a98b3503ad32bf1f2db3c8d
parente57690fe009b2ab0cee8a57f53be634540e49c9d (diff)
blk-mq: improve warning for running a queue on the wrong CPU
__blk_mq_run_hw_queue() currently warns if we are running the queue on a CPU that isn't set in its mask. However, this can happen if a CPU is being offlined, and the workqueue handling will place the work on CPU0 instead. Improve the warning so that it only triggers if the batch cpu in the hardware queue is currently online. If it triggers for that case, then it's indicative of a flow problem in blk-mq, so we want to retain it for that case. Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--block/blk-mq.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 729169d022fc..13f5a6c1de76 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -793,11 +793,12 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
793 struct list_head *dptr; 793 struct list_head *dptr;
794 int queued; 794 int queued;
795 795
796 WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask));
797
798 if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state))) 796 if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state)))
799 return; 797 return;
800 798
799 WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) &&
800 cpu_online(hctx->next_cpu));
801
801 hctx->run++; 802 hctx->run++;
802 803
803 /* 804 /*