From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932710AbcKHJyg (ORCPT ); Tue, 8 Nov 2016 04:54:36 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:38632 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932443AbcKHJye (ORCPT ); Tue, 8 Nov 2016 04:54:34 -0500 From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com Cc: yuyang.du@intel.com, Morten.Rasmussen@arm.com, pjt@google.com, bsegall@google.com, kernellwp@gmail.com, Vincent Guittot Subject: [PATCH 0/6 v7] sched: reflect sched_entity move into task_group's load Date: Tue, 8 Nov 2016 10:53:41 +0100 Message-Id: <1478598827-32372-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ensure that the move of a sched_entity will be reflected in load and utilization of the task_group hierarchy. When a sched_entity moves between groups or CPUs, load and utilization of cfs_rq don't reflect the changes immediately but converge to new values. As a result, the metrics are no more aligned with the new balance of the load in the system and next decisions will have a biased view. This patchset synchronizes load/utilization of sched_entity with its child cfs_rq (se->my-q) only when tasks move to/from child cfs_rq: -move between task group -migration between CPUs Otherwise, PELT is updated as usual. This version doesn't include any changes related to discussion that have started during the review of the previous version about: - encapsulate the sequence for changing the property of a task - remove a cfs_rq from list during update_blocked_averages These topics don't gain anything from being added in this patchset as they are fairly independent and deserve a separate patch. Changes since v6: -fix warning and error raised by lkp Changes since v5: - factorize detach entity like for attach - fix add_positive - Fixed few coding style Changes since v4: - minor typo and commit message changes - move call to cfs_rq_clock_task(cfs_rq) in post_init_entity_util_avg Changes since v3: - Replaced the 2 arguments of update_load_avg by 1 flags argument - Propagated move in runnable_load_avg when sched_entity is already on_rq - Ensure that intermediate value will not reach memory when updating load and utilization - Optimize the the calculation of load_avg of the sched_entity - Fixed some typo Changes since v2: - Propagate both utilization and load - Synced sched_entity and se->my_q instead of adding the delta Changes since v1: - This patch needs the patch that fixes issue with rq->leaf_cfs_rq_list "sched: fix hierarchical order in rq->leaf_cfs_rq_list" in order to work correctly. I haven't sent them as a single patchset because the fix is independent of this one - Merge some functions that are always used together - During update of blocked load, ensure that the sched_entity is synced with the cfs_rq applying changes - Fix an issue when task changes its cpu affinity Vincent Guittot (6): sched: factorize attach/detach entity sched: fix hierarchical order in rq->leaf_cfs_rq_list sched: factorize PELT update sched: propagate load during synchronous attach/detach sched: propagate asynchrous detach sched: fix task group initialization kernel/sched/core.c | 1 + kernel/sched/fair.c | 395 ++++++++++++++++++++++++++++++++++++++++----------- kernel/sched/sched.h | 2 + 3 files changed, 318 insertions(+), 80 deletions(-) -- 2.7.4