blk-mq: make the polling code adaptive
authorJens Axboe <axboe@fb.com>
Mon, 14 Nov 2016 20:03:03 +0000 (13:03 -0700)
committerJens Axboe <axboe@fb.com>
Thu, 17 Nov 2016 05:20:29 +0000 (22:20 -0700)
commit6fe26bc8f2329450dc233ac4cec8981d8a16a6e5
tree9de820c64698aa00add5c906663dd4ecc8270502
parent06fc75b46ebaf8f10c1355135cd0799d34a09bfb
blk-mq: make the polling code adaptive

The previous commit introduced the hybrid sleep/poll mode. Take
that one step further, and use the completion latencies to
automatically sleep for half the mean completion time. This is
a good approximation.

This changes the 'io_poll_delay' sysfs file a bit to expose the
various options. Depending on the value, the polling code will
behave differently:

-1 Never enter hybrid sleep mode
 0 Use half of the completion mean for the sleep delay
>0 Use this specific value as the sleep delay

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
include/linux/blkdev.h