blk-mq: don't use preempt_count() to check for right CPU
authorJens Axboe <axboe@fb.com>
Wed, 16 Apr 2014 15:23:48 +0000 (09:23 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 16 Apr 2014 20:15:24 +0000 (14:15 -0600)
UP or CONFIG_PREEMPT_NONE will return 0, and what we really
want to check is whether or not we are on the right CPU.
So don't make PREEMPT part of this, just test the CPU in
the mask directly.

Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c

index 9180052d42cc13ed476471350e2f7934b8b2f006..1fa01ff0f9bce11a4bc24001e0bdcd14016c3ac0 100644 (file)
@@ -534,7 +534,7 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
        LIST_HEAD(rq_list);
        int bit, queued;
 
-       WARN_ON(!preempt_count());
+       WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask));
 
        if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state)))
                return;