blk-mq: Don't complete on a remote CPU in force threaded mode
[linux-2.6-microblaze.git] / block / blk-mq.c
index a428798..c338c9b 100644 (file)
@@ -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 ||