[Devel] [PATCH rh7] sched: Hide steal time from inside CT
Kirill Tkhai
ktkhai at odin.com
Tue Oct 6 06:11:54 PDT 2015
https://jira.sw.ru/browse/PSBM-26588
Port diff-sched-hide-steal-time-from-inside-CT from 2.6.32:
>From the BUG by Khorenko Konstantin:
"FastVPS complains on incorrect idle time calculation
(PSBM-23431) and about high _steal_ time reported inside a CT.
Steal time is a time when a CT was ready to run on a physical CPU,
but the CPU was busy with processes which belong to another CT.
=> in case we have 10 CTs which eat cpu time as much as possible,
then steal time in each CT will be 90% and execution time 10% only.
i suggest to make steal time always shown as 0 inside Containers in
order not to confuse end users. At the same time steal time for
Containers should be visible from the HN (host), this is useful for
development.
No objections neither from Pasha Emelyanov nor from Maik".
So, we do this for not to scare users.
Signed-off-by: Kirill Tkhai <ktkhai at parallels.com>
Acked-by: Vladimir Davydov <vdavydov at parallels.com>
Signed-off-by: Kirill Tkhai <ktkhai at parallels.com>
---
Konstantin, please, review
kernel/sched/core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index df63b3a..1277c18 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8999,6 +8999,9 @@ int cpu_cgroup_proc_stat(struct cgroup *cgrp, struct cftype *cft,
steal += kcpustat->cpustat[CPUTIME_STEAL];
}
+ if (!ve_is_super(get_exec_env()))
+ steal = 0;
+
seq_printf(p, "cpu %llu %llu %llu %llu %llu 0 0 %llu\n",
(unsigned long long)cputime64_to_clock_t(user),
(unsigned long long)cputime64_to_clock_t(nice),
@@ -9018,6 +9021,8 @@ int cpu_cgroup_proc_stat(struct cgroup *cgrp, struct cftype *cft,
idle = kcpustat->cpustat[CPUTIME_IDLE];
iowait = kcpustat->cpustat[CPUTIME_IOWAIT];
steal = kcpustat->cpustat[CPUTIME_STEAL];
+ if (!ve_is_super(get_exec_env()))
+ steal = 0;
seq_printf(p,
"cpu%d %llu %llu %llu %llu %llu 0 0 %llu\n",
i,
More information about the Devel
mailing list