[RHEL7,COMMIT] sched/ve: Iterate only VE root cpu cgroups to count loadavg

Submitted by Konstantin Khorenko on Feb. 27, 2018, 12:28 p.m.


Message ID 201802271228.w1RCSUGK014669@finist_ce7.work
State New
Series "Fix wrong loadavg accounting inside CT"
Headers show

Commit Message

Konstantin Khorenko Feb. 27, 2018, 12:28 p.m.
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 d1ad42524d70880b2402979f5051e329d79f5eed
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Tue Feb 27 15:28:30 2018 +0300

    sched/ve: Iterate only VE root cpu cgroups to count loadavg
    Counting loadavg we are interested in VE root cpu cgroup only,
    as it's analogy of node's loadavg.
    So, this patch makes iterate only such types of cpu cgroup,
    when we calc loadavg.
    Since this code called from interrupt, this may give positive
    performance resuts.
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
    Reviewed-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
 kernel/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index cc01aff0e6ea..f93334fd0229 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2890,7 +2890,7 @@  static void calc_load_ve(void)
 	int i;
-	list_for_each_entry_rcu(tg, &task_groups, list) {
+	list_for_each_entry_rcu(tg, &ve_root_list, ve_root_list) {
 		nr_active = 0;
 		for_each_possible_cpu(i) {