aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2015-06-01 19:35:10 -0400
committerJens Axboe <axboe@fb.com>2015-06-01 22:09:05 -0400
commit8b70f45e2eb275da886b9c9dee190436d12d876a (patch)
treeae6830a996f4e54980dc8c8bcdf4a2a058e9b38e /drivers/block
parent419c21a3b6275d40a10901f700efcd40515b6db6 (diff)
null_blk: restart request processing on completion handler
When irqmode=2 (IRQ completion handler is timer) and queue_mode=1 (Block interface to use is rq), the completion handler should restart request handling for any pending requests on a queue because request processing stops when the number of commands are queued more than hw_queue_depth (null_rq_prep_fn returns BLKPREP_DEFER). Without this change, the following command cannot finish. # modprobe null_blk irqmode=2 queue_mode=1 hw_queue_depth=1 # fio --name=t --rw=read --size=1g --direct=1 \ --ioengine=libaio --iodepth=64 --filename=/dev/nullb0 Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Jens Axboe <axboe@fb.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/null_blk.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index 6f0a58e7613d..6f9b7534928e 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -243,6 +243,17 @@ static enum hrtimer_restart null_cmd_timer_expired(struct hrtimer *timer)
243 cmd = container_of(entry, struct nullb_cmd, ll_list); 243 cmd = container_of(entry, struct nullb_cmd, ll_list);
244 entry = entry->next; 244 entry = entry->next;
245 end_cmd(cmd); 245 end_cmd(cmd);
246
247 if (cmd->rq) {
248 struct request_queue *q = cmd->rq->q;
249
250 if (!q->mq_ops && blk_queue_stopped(q)) {
251 spin_lock(q->queue_lock);
252 if (blk_queue_stopped(q))
253 blk_start_queue(q);
254 spin_unlock(q->queue_lock);
255 }
256 }
246 } while (entry); 257 } while (entry);
247 } 258 }
248 259
@@ -334,6 +345,7 @@ static int null_rq_prep_fn(struct request_queue *q, struct request *req)
334 req->special = cmd; 345 req->special = cmd;
335 return BLKPREP_OK; 346 return BLKPREP_OK;
336 } 347 }
348 blk_stop_queue(q);
337 349
338 return BLKPREP_DEFER; 350 return BLKPREP_DEFER;
339} 351}