[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <aa5f702d-30e3-77e2-084b-3a618204e9e8@huawei.com>
Date: Thu, 18 Jul 2024 21:02:08 +0800
From: "zhaowenhui (A)" <zhaowenhui8@...wei.com>
To: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>, Vincent Guittot
<vincent.guittot@...aro.org>, Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>, Mel
Gorman <mgorman@...e.de>, Daniel Bristot de Oliveira <bristot@...hat.com>,
Valentin Schneider <vschneid@...hat.com>, "open list:SCHEDULER"
<linux-kernel@...r.kernel.org>
CC: <zhangqiao22@...wei.com>, <tanghui20@...wei.com>
Subject: [BUG REPORT] sched/rt: Inaccurate numerical calculation in
rt_runtime_us constraints
Hello,
Recently, we find that the cgroup rt_runtime_us's constraints is not
precise enough in some cases. For example:
(1)
create a father cgroup and a child cgroup, and we exec:
echo 1048577 > /sys/fs/cgroup/cpu/father/cpu.rt_period_us
echo 1048577 > /sys/fs/cgroup/cpu/father/child/cpu.rt_period_us
echo 0 > /sys/fs/cgroup/cpu/father/cpu.rt_runtime_us
echo 1 > /sys/fs/cgroup/cpu/father/child/cpu.rt_runtime_us
(2)
create a father cgroup and two child cgroups, and we exec:
echo 20000 > /sys/fs/cgroup/cpu/father/cpu.rt_runtime_us
echo 10000 > /sys/fs/cgroup/cpu/father/child1/cpu.rt_runtime_us
echo 10001 > /sys/fs/cgroup/cpu/father/child2/cpu.rt_runtime_us
Logically speaking, the sum of child cgroups' rt_runtime_us should be
less than the fater's rt_runtime_us, but actually both cases above would
work. Because in to_ratio(), "div64_u64(runtime << BW_SHIFT, period)"
ignores the remainders. So if the rt_period_us is big or many child
cgroups' remainders are ignored, it could happen.
But after all, it doesn't damage a lot, and seems not so easy to fix. So
I report this and see what can we do about it.
---
Regards
Zhao Wenhui
Powered by blists - more mailing lists