Commit 8c9bb956 authored by Zhao Wenhui's avatar Zhao Wenhui Committed by Zheng Zengkai
Browse files

sched/fair: limit burst to zero when cfs bandwidth is toggled off

hulk inclusion
category: bugfix
bugzilla: 187464, https://gitee.com/openeuler/kernel/issues/I612GU



--------------------------------

sched/fair: limit burst to zero when cfs bandwidth is toggled off

When the quota value in CFS bandwidth is set to -1, that imples the
cfs bandwidth is toggled off. So the burst feature is supposed to
be disable as well.

Currently, when quota is -1, burst will not be check, so that it can be
set to almost arbitery value. Examples:
        mkdir /sys/fs/cgroup/cpu/test
        echo -1 > /sys/fs/cgroup/cpu/test/cpu.cfs_quota_us
        echo 10000000000000000 > /sys/fs/cgroup/cpu/test/cpu.cfs_burst_us

Moreover, after the burst modified by this way, quota can't be set
to any value:
        echo 100000 > cpu.cfs_quota_us
        -bash: echo: write error: Invalid argument

This patch can ensure the burst value being zero and unalterable,
when quota is set to -1.

Fixes: f4183717 ("sched/fair: Introduce the burstable CFS controller")
Signed-off-by: default avatarZhao Wenhui <zhaowenhui8@huawei.com>
Signed-off-by: default avatarZheng Zucheng <zhengzucheng@huawei.com>
Reviewed-by: default avatarZhang Qiao <zhangqiao22@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 0d813f1e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment