[Devel] [PATCH RHEL7 COMMIT] ve/sched: Hide steal time from inside CT
Konstantin Khorenko
khorenko at virtuozzo.com
Wed Oct 7 04:22:33 PDT 2015
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.8.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.8.3
------>
commit 744efff9ff308203a9fca42da982edcbb04bcb49
Author: Kirill Tkhai <ktkhai at odin.com>
Date: Wed Oct 7 15:22:33 2015 +0400
ve/sched: Hide steal time from inside CT
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 virtuozzo.com>
Reviewed-by: Vladimir Davydov <vdavydov at virtuozzo.com>
kernel/sched/core.c | 5 +++++
1 file changed, 5 insertions(+)
---
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