From 419c21a3b6275d40a10901f700efcd40515b6db6 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Tue, 2 Jun 2015 08:35:09 +0900 Subject: [PATCH] null_blk: prevent timer handler running on a different CPU where started When irqmode=2 (IRQ completion handler is timer), timer handler should be called on the same CPU where the timer has been started. Since completion_queues are per-cpu and the completion handler only touches completion_queue for local CPU, we need to prevent the handler from running on a different CPU where the timer has been started. Otherwise, the IO cannot be completed until another completion handler is executed on that CPU. Signed-off-by: Akinobu Mita Cc: Jens Axboe Signed-off-by: Jens Axboe --- drivers/block/null_blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index 65cd61a4145e..6f0a58e7613d 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -257,7 +257,7 @@ static void null_cmd_end_timer(struct nullb_cmd *cmd) if (llist_add(&cmd->ll_list, &cq->list)) { ktime_t kt = ktime_set(0, completion_nsec); - hrtimer_start(&cq->timer, kt, HRTIMER_MODE_REL); + hrtimer_start(&cq->timer, kt, HRTIMER_MODE_REL_PINNED); } put_cpu(); -- 2.20.1