diff options
author | Shaohua Li <shli@fb.com> | 2017-03-27 15:19:42 -0700 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-03-28 08:02:20 -0600 |
commit | b9147dd1bae2b15d6931ecd42f8606c775fecbc9 (patch) | |
tree | 9becbcfbf24e535538680bb53f38962808b4e28e /scripts | |
parent | 88eeca495ba7de749ff253376ec6be19bb05368d (diff) | |
download | linux-b9147dd1bae2b15d6931ecd42f8606c775fecbc9.tar.gz linux-b9147dd1bae2b15d6931ecd42f8606c775fecbc9.tar.bz2 linux-b9147dd1bae2b15d6931ecd42f8606c775fecbc9.zip |
blk-throttle: add a mechanism to estimate IO latency
User configures latency target, but the latency threshold for each
request size isn't fixed. For a SSD, the IO latency highly depends on
request size. To calculate latency threshold, we sample some data, eg,
average latency for request size 4k, 8k, 16k, 32k .. 1M. The latency
threshold of each request size will be the sample latency (I'll call it
base latency) plus latency target. For example, the base latency for
request size 4k is 80us and user configures latency target 60us. The 4k
latency threshold will be 80 + 60 = 140us.
To sample data, we calculate the order base 2 of rounded up IO sectors.
If the IO size is bigger than 1M, it will be accounted as 1M. Since the
calculation does round up, the base latency will be slightly smaller
than actual value. Also if there isn't any IO dispatched for a specific
IO size, we will use the base latency of smaller IO size for this IO
size.
But we shouldn't sample data at any time. The base latency is supposed
to be latency where disk isn't congested, because we use latency
threshold to schedule IOs between cgroups. If disk is congested, the
latency is higher, using it for scheduling is meaningless. Hence we only
do the sampling when block throttling is in the LOW limit, with
assumption disk isn't congested in such state. If the assumption isn't
true, eg, low limit is too high, calculated latency threshold will be
higher.
Hard disk is completely different. Latency depends on spindle seek
instead of request size. Currently this feature is SSD only, we probably
can use a fixed threshold like 4ms for hard disk though.
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions