blk-mq: improve support for shared tags maps
authorJens Axboe <axboe@fb.com>
Tue, 13 May 2014 21:10:52 +0000 (15:10 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 30 Mar 2015 18:54:47 +0000 (12:54 -0600)
commit0008666aa4712701cc90b36de26150a7b59ef0e2
tree291c742d1338ecf8fa4ec3d0c0339fa3fd4e9a27
parent575fb5faf5aa8d46694647c7188f8b5b949c837b
blk-mq: improve support for shared tags maps

This adds support for active queue tracking, meaning that the
blk-mq tagging maintains a count of active users of a tag set.
This allows us to maintain a notion of fairness between users,
so that we can distribute the tag depth evenly without starving
some users while allowing others to try unfair deep queues.

If sharing of a tag set is detected, each hardware queue will
track the depth of its own queue. And if this exceeds the total
depth divided by the number of active queues, the user is actively
throttled down.

The active queue count is done lazily to avoid bouncing that data
between submitter and completer. Each hardware queue gets marked
active when it allocates its first tag, and gets marked inactive
when 1) the last tag is cleared, and 2) the queue timeout grace
period has passed.

Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq-sysfs.c
block/blk-mq-tag.c
block/blk-mq-tag.h
block/blk-mq.c
block/blk-timeout.c
block/blk.h
include/linux/blk-mq.h
include/linux/blk_types.h
include/linux/blkdev.h