blk-mq: private O_DIRECT implementation
authorJens Axboe <axboe@fb.com>
Sat, 13 Aug 2016 02:36:36 +0000 (20:36 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 8 Sep 2016 18:10:26 +0000 (12:10 -0600)
commitf4f5253edcda3532f236667202648c2047033fcc
treea3340944e2a22bfc651c5634242adc36f3fadccb
parentc6935931c1894ff857616ff8549b61236a19148f
blk-mq: private O_DIRECT implementation

Only enabled for single vec blk-mq devices for now, and only for
synchronous O_DIRECT (not libaio). Much quicker than the slob
that is fs/direct-io.c.

With polling, I can get 5-6 usec latencies with 4KB IO.

This patch also 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.

Testing done on a Radian Memory Systems RMS-200/4G DRAM backed
NVMe device.

Signed-off-by: Jens Axboe <axboe@fb.com>
block/Makefile
block/blk-core.c
block/blk-mq-dio.c [new file with mode: 0644]
block/blk-mq.c
block/blk-mq.h
block/blk-sysfs.c
block/blk.h
fs/block_dev.c
fs/direct-io.c
include/linux/blk_types.h
include/linux/blkdev.h