]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cfq-iosched: fix the delay of cfq_group's vdisktime under iops mode
authorHou Tao <houtao1@huawei.com>
Wed, 1 Mar 2017 01:02:33 +0000 (09:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2017 13:05:58 +0000 (15:05 +0200)
commit08229c119c426fc8666f1dc2822a8c38fc77fa6a
tree7500477a188169236f92b1b67f604f8f5ad9319a
parent1f67d28d2707dc1da24c7f94b0a80721ea89abac
cfq-iosched: fix the delay of cfq_group's vdisktime under iops mode

commit 5be6b75610cefd1e21b98a218211922c2feb6e08 upstream.

When adding a cfq_group into the cfq service tree, we use CFQ_IDLE_DELAY
as the delay of cfq_group's vdisktime if there have been other cfq_groups
already.

When cfq is under iops mode, commit 9a7f38c42c2b ("cfq-iosched: Convert
from jiffies to nanoseconds") could result in a large iops delay and
lead to an abnormal io schedule delay for the added cfq_group. To fix
it, we just need to revert to the old CFQ_IDLE_DELAY value: HZ / 5
when iops mode is enabled.

Despite having the same value, the delay of a cfq_queue in idle class
and the delay of cfq_group are different things, so I define two new
macros for the delay of a cfq_group under time-slice mode and iops mode.

Fixes: 9a7f38c42c2b ("cfq-iosched: Convert from jiffies to nanoseconds")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/cfq-iosched.c