summaryrefslogtreecommitdiffstats
path: root/block/bfq-iosched.c
diff options
context:
space:
mode:
authorDavide Sapienza <sapienza.dav@gmail.com>2018-05-31 10:45:07 -0400
committerJens Axboe <axboe@kernel.dk>2018-05-31 10:54:40 -0400
commitd450542e3ce0efd030316b7846cc7231300b2bc9 (patch)
treebd11d9631967d11e17b7237c862fc29a304a13f5 /block/bfq-iosched.c
parente24f1c245fb61b799137b586ea7ac3c6a5e952be (diff)
block, bfq: increase weight-raising duration for interactive apps
The maximum possible duration of the weight-raising period for interactive applications is limited to 13 seconds, as this is the time needed to load the largest application that we considered when tuning weight raising. Unfortunately, in such an evaluation, we did not consider the case of very slow virtual machines. For example, on a QEMU/KVM virtual machine - running in a slow PC; - with a virtual disk stacked on a slow low-end 5400rpm HDD; - serving a heavy I/O workload, such as the sequential reading of several files; mplayer takes 23 seconds to start, if constantly weight-raised. To address this issue, this commit conservatively sets the upper limit for weight-raising duration to 25 seconds. Signed-off-by: Davide Sapienza <sapienza.dav@gmail.com> Signed-off-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bfq-iosched.c')
-rw-r--r--block/bfq-iosched.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 21011019f5df..128b3be49463 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -876,22 +876,26 @@ static unsigned int bfq_wr_duration(struct bfq_data *bfqd)
876 do_div(dur, bfqd->peak_rate); 876 do_div(dur, bfqd->peak_rate);
877 877
878 /* 878 /*
879 * Limit duration between 3 and 13 seconds. Tests show that 879 * Limit duration between 3 and 25 seconds. The upper limit
880 * higher values than 13 seconds often yield the opposite of 880 * has been conservatively set after the following worst case:
881 * the desired result, i.e., worsen responsiveness by letting 881 * on a QEMU/KVM virtual machine
882 * non-interactive and non-soft-real-time applications 882 * - running in a slow PC
883 * preserve weight raising for a too long time interval. 883 * - with a virtual disk stacked on a slow low-end 5400rpm HDD
884 * - serving a heavy I/O workload, such as the sequential reading
885 * of several files
886 * mplayer took 23 seconds to start, if constantly weight-raised.
887 *
888 * As for higher values than that accomodating the above bad
889 * scenario, tests show that higher values would often yield
890 * the opposite of the desired result, i.e., would worsen
891 * responsiveness by allowing non-interactive applications to
892 * preserve weight raising for too long.
884 * 893 *
885 * On the other end, lower values than 3 seconds make it 894 * On the other end, lower values than 3 seconds make it
886 * difficult for most interactive tasks to complete their jobs 895 * difficult for most interactive tasks to complete their jobs
887 * before weight-raising finishes. 896 * before weight-raising finishes.
888 */ 897 */
889 if (dur > msecs_to_jiffies(13000)) 898 return clamp_val(dur, msecs_to_jiffies(3000), msecs_to_jiffies(25000));
890 dur = msecs_to_jiffies(13000);
891 else if (dur < msecs_to_jiffies(3000))
892 dur = msecs_to_jiffies(3000);
893
894 return dur;
895} 899}
896 900
897/* switch back from soft real-time to interactive weight raising */ 901/* switch back from soft real-time to interactive weight raising */