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>
This commit is contained in:
@@ -509,7 +509,7 @@ struct request_queue {
|
||||
unsigned int request_fn_active;
|
||||
|
||||
unsigned int rq_timeout;
|
||||
unsigned int poll_nsec;
|
||||
int poll_nsec;
|
||||
struct timer_list timeout;
|
||||
struct work_struct timeout_work;
|
||||
struct list_head timeout_list;
|
||||
|
Reference in New Issue
Block a user