blk-mq: implement hybrid poll mode for sync O_DIRECT
authorJens Axboe <axboe@fb.com>
Mon, 14 Nov 2016 20:01:59 +0000 (13:01 -0700)
committerJens Axboe <axboe@fb.com>
Thu, 17 Nov 2016 05:20:29 +0000 (22:20 -0700)
commit06fc75b46ebaf8f10c1355135cd0799d34a09bfb
treee3636ecb733e1fdc5ca0a9266997a0500001531d
parent61a753e9f9097373d037e240558a2d45382138cf
blk-mq: implement hybrid poll mode for sync O_DIRECT

This patch enables a hybrid polling mode. Instead of polling after IO
submission, we can induce an artificial delay, and then poll after that.
For example, if the IO is presumed to complete in 8 usecs from now, we
can sleep for 4 usecs, wake up, and then do our polling. This still puts
a sleep/wakeup cycle in the IO path, but instead of the wakeup happening
after the IO has completed, it'll happen before. With this hybrid
scheme, we can achieve big latency reductions while still using the same
(or less) amount of CPU.

Signed-off-by: Jens Axboe <axboe@fb.com>
Tested-By: Stephen Bates <sbates@raithlin.com>
Reviewed-By: Stephen Bates <sbates@raithlin.com>
block/blk-mq.c
block/blk-sysfs.c
block/blk.h
include/linux/blkdev.h