[Devel] [PATCH RHEL7 COMMIT] sched/ve: Do not show loadavg in child VE cpu cgroups

Konstantin Khorenko khorenko at virtuozzo.com
Tue Feb 27 15:28:29 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-693.17.1.vz7.45.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.17.1.vz7.45.4
------>
commit e0199c52bdf40d8856ec8ff2ae664cbafee872fb
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Tue Feb 27 15:28:29 2018 +0300

    sched/ve: Do not show loadavg in child VE cpu cgroups
    
    CT's loadavg is analogy of node's loadavg, and we shouldn't
    introduce it for child cpu cgroups.
    
    We can remove the file completely only for root_task_group,
    other will return empty file content.
    
    https://jira.sw.ru/browse/PSBM-81572
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    Reviewed-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 kernel/sched/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 9bfae156e6d5..cc01aff0e6ea 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -10175,6 +10175,9 @@ int cpu_cgroup_proc_loadavg(struct cgroup *cgrp, struct cftype *cft,
 	int nr_running = 0;
 	int i;
 
+	if (!test_bit(CGRP_VE_ROOT, &cgrp->flags))
+		return 0;
+
 	avnrun[0] = tg->avenrun[0] + FIXED_1/200;
 	avnrun[1] = tg->avenrun[1] + FIXED_1/200;
 	avnrun[2] = tg->avenrun[2] + FIXED_1/200;
@@ -10325,6 +10328,7 @@ static struct cftype cpu_files[] = {
 	{
 		.name = "proc.loadavg",
 		.read_seq_string = cpu_cgroup_proc_loadavg,
+		.flags = CFTYPE_NOT_ON_ROOT,
 	},
 	{
 		.name = "delayacct.total",


More information about the Devel mailing list