diff options
author | Ritesh Harjani <riteshh@codeaurora.org> | 2017-08-08 10:20:56 +0530 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-12-23 23:43:31 +0200 |
commit | 047584c7dedc77529c21897c88413092124fdc78 (patch) | |
tree | a7a9648b9984e064f5f5574dbb43f066c1b6cef1 /block/cfq-iosched.c | |
parent | 42d94f95f6d93958804e8608c0ae713bb407015b (diff) |
cfq: Give a chance to arm slice idle timer in case of group_idle
In below scenario blkio cgroup does not work as per their assigned
weights :-
1. When the underlying device is nonrotational with a single HW queue
with depth of > 5
2. When the use case is forming two blkio cgroups cg1(weight 1000) &
cg2(wight 100) and two processes(file1 and file2) doing sync IO in
their respective blkio cgroups.
For above usecase result of fio (without this patch):-
file1: (groupid=0, jobs=1): err= 0: pid=685: Thu Jan 1 19:41:49 1970
write: IOPS=1315, BW=41.1MiB/s (43.1MB/s)(1024MiB/24906msec)
<...>
file2: (groupid=0, jobs=1): err= 0: pid=686: Thu Jan 1 19:41:49 1970
write: IOPS=1295, BW=40.5MiB/s (42.5MB/s)(1024MiB/25293msec)
<...>
// both the process BW is equal even though they belong to different
cgroups with weight of 1000(cg1) and 100(cg2)
In above case as soon as the request from cg1 is completed and even
though it is provided with higher slice_idle=10, because of CFQ
algorithm when the driver tries to fetch the request, CFQ expires
this group without providing any idle time nor weight priority
and schedules another cfq group (in this case cg2).
And thus both cfq groups(cg1 & cg2) keep alternating to get the
disk time and hence loses the cgroup weight based scheduling.
Below patch gives a chance to cfq algorithm (cfq_arm_slice_timer)
to arm the slice timer in case group_idle is enabled.
With this patch result of fio(for above usecase) :-
file1: (groupid=0, jobs=1): err= 0: pid=690: Thu Jan 1 00:06:08 1970
write: IOPS=1706, BW=53.3MiB/s (55.9MB/s)(1024MiB/19197msec)
<..>
file2: (groupid=0, jobs=1): err= 0: pid=691: Thu Jan 1 00:06:08 1970
write: IOPS=1043, BW=32.6MiB/s (34.2MB/s)(1024MiB/31401msec)
<..>
// In this processes BW is as per their respective cgroups weight.
Change-Id: I2eb20e48d6fd8ee48e01f00c514a1ee1476fd19c
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 4e1f49434bbe..f578ff217a95 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -2902,8 +2902,8 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd) /* * SSD device without seek penalty, disable idling. But only do so - * for devices that support queuing, otherwise we still have a problem - * with sync vs async workloads. + * for devices that support queuing (and when group idle is 0), + * otherwise we still have a problem with sync vs async workloads. */ if (blk_queue_nonrot(cfqd->queue) && cfqd->hw_tag && !cfqd->cfq_group_idle) |