block/mq: don't complete requests via IPI

The IPI runs in hardirq context and there are sleeping locks. Assume caches are
shared and complete them on the local CPU.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
This commit is contained in:
Sebastian Andrzej Siewior 2015-01-29 15:10:08 +01:00 committed by Alibek Omarov
parent 4abe6b99f0
commit bad3589dc7
1 changed files with 8 additions and 0 deletions

View File

@ -612,8 +612,16 @@ static void __blk_mq_complete_request(struct request *rq)
}
cpu = get_cpu_light();
/*
* Avoid SMP function calls for completions because they acquire
* sleeping spinlocks on RT.
*/
#ifdef CONFIG_PREEMPT_RT
shared = true;
#else
if (!test_bit(QUEUE_FLAG_SAME_FORCE, &q->queue_flags))
shared = cpus_share_cache(cpu, ctx->cpu);
#endif
if (cpu != ctx->cpu && !shared && cpu_online(ctx->cpu)) {
rq->csd.func = __blk_mq_complete_request_remote;