[Devel] [PATCH 5/5] sched/ve: Use cfs_rq::h_nr_running to count loadavg
ktkhai at virtuozzo.com
Tue Feb 20 18:10:09 MSK 2018
cfs_rq::nr_running contains number of child entities
of one level below: tasks and cfs_rq, but it does not
contain tasks from deeper levels.
Use cfs_rq::h_nr_running instead as it contains number
of tasks among all child hierarchy.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
kernel/sched/core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f93334fd0229..f14bbf5c8ed6 100644
@@ -2894,7 +2894,13 @@ static void calc_load_ve(void)
nr_active = 0;
- nr_active += tg->cfs_rq[i]->nr_running;
+ nr_active += tg->cfs_rq[i]->h_nr_running;
+ * We do not export nr_unint to parent task groups
+ * like we do for h_nr_running, as it gives additional
+ * overhead for activate/deactivate operations. So, we
+ * don't account child cgroup unint tasks here.
nr_active += tg->cfs_rq[i]->nr_unint;
More information about the Devel