[4/5] sched/ve: Iterate only VE root cpu cgroups to count loadavg

Submitted by Kirill Tkhai on Feb. 20, 2018, 3:09 p.m.

Details

Message ID 151913939985.27906.9293798747787876443.stgit@localhost.localdomain
State New
Series "Fix wrong loadavg accounting inside CT"
Headers show

Commit Message

Kirill Tkhai Feb. 20, 2018, 3:09 p.m.
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.

https://jira.sw.ru/browse/PSBM-81572

Signed-off-by: Kirill Tkhai <ktkhai@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;
 
 	rcu_read_lock();
-	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) {
 #ifdef CONFIG_FAIR_GROUP_SCHED