Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[linux-2.6-microblaze.git] / block / blk-mq.c
index b09ce00..f285a91 100644 (file)
@@ -294,8 +294,8 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data,
        rq->mq_hctx = data->hctx;
        rq->rq_flags = 0;
        rq->cmd_flags = data->cmd_flags;
-       if (data->flags & BLK_MQ_REQ_PREEMPT)
-               rq->rq_flags |= RQF_PREEMPT;
+       if (data->flags & BLK_MQ_REQ_PM)
+               rq->rq_flags |= RQF_PM;
        if (blk_queue_io_stat(data->q))
                rq->rq_flags |= RQF_IO_STAT;
        INIT_LIST_HEAD(&rq->queuelist);
@@ -650,6 +650,14 @@ static inline bool blk_mq_complete_need_ipi(struct request *rq)
        if (!IS_ENABLED(CONFIG_SMP) ||
            !test_bit(QUEUE_FLAG_SAME_COMP, &rq->q->queue_flags))
                return false;
+       /*
+        * With force threaded interrupts enabled, raising softirq from an SMP
+        * function call will always result in waking the ksoftirqd thread.
+        * This is probably worse than completing the request on a different
+        * cache domain.
+        */
+       if (force_irqthreads)
+               return false;
 
        /* same CPU or cache domain?  Complete locally */
        if (cpu == rq->mq_ctx->cpu ||
@@ -1495,31 +1503,6 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
 {
        int srcu_idx;
 
-       /*
-        * We should be running this queue from one of the CPUs that
-        * are mapped to it.
-        *
-        * There are at least two related races now between setting
-        * hctx->next_cpu from blk_mq_hctx_next_cpu() and running
-        * __blk_mq_run_hw_queue():
-        *
-        * - hctx->next_cpu is found offline in blk_mq_hctx_next_cpu(),
-        *   but later it becomes online, then this warning is harmless
-        *   at all
-        *
-        * - hctx->next_cpu is found online in blk_mq_hctx_next_cpu(),
-        *   but later it becomes offline, then the warning can't be
-        *   triggered, and we depend on blk-mq timeout handler to
-        *   handle dispatched requests to this 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();
-       }
-
        /*
         * We can't run the queue inline with ints disabled. Ensure that
         * we catch bad users of this early.