Skip to content

Commit

Permalink
null_blk: prevent timer handler running on a different CPU where started
Browse files Browse the repository at this point in the history
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 <akinobu.mita@gmail.com>
Cc: Jens Axboe <axboe@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Akinobu Mita authored and Jens Axboe committed Jun 2, 2015
1 parent 4248322 commit 419c21a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/null_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 419c21a

Please sign in to comment.