Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753054AbbHSGsC (ORCPT ); Wed, 19 Aug 2015 02:48:02 -0400 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:60249 "EHLO lgemrelse7q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752740AbbHSGrz (ORCPT ); Wed, 19 Aug 2015 02:47:55 -0400 X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com From: byungchul.park@lge.com To: mingo@kernel.org, peterz@infradead.org Cc: linux-kernel@vger.kernel.org, yuyang.du@intel.com, Byungchul Park Subject: [PATCH v3 2/5] sched: make task_move_group_fair adjust cfs_rq's load in case of queued Date: Wed, 19 Aug 2015 15:47:13 +0900 Message-Id: <1439966836-11266-3-git-send-email-byungchul.park@lge.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1439966836-11266-1-git-send-email-byungchul.park@lge.com> References: <1439966836-11266-1-git-send-email-byungchul.park@lge.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1586 Lines: 47 From: Byungchul Park se's average load should be added to new cfs_rq, not only in case of !queued but also in case of queued. of course, older code managed cfs_rq's blocked load separately. in that case, the blocked load was meaningful only in case that the se is in !queued. but now load tracking code is changed, it is not true. code adjusting cfs_rq's average load should be changed. Signed-off-by: Byungchul Park --- kernel/sched/fair.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7475a40..191d9be 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8044,15 +8044,13 @@ static void task_move_group_fair(struct task_struct *p, int queued) se->vruntime -= cfs_rq_of(se)->min_vruntime; set_task_rq(p, task_cpu(p)); se->depth = se->parent ? se->parent->depth + 1 : 0; - if (!queued) { - cfs_rq = cfs_rq_of(se); + cfs_rq = cfs_rq_of(se); + if (!queued) se->vruntime += cfs_rq->min_vruntime; - #ifdef CONFIG_SMP - /* Virtually synchronize task with its new cfs_rq */ - attach_entity_load_avg(cfs_rq, se); + /* Virtually synchronize task with its new cfs_rq */ + attach_entity_load_avg(cfs_rq, se); #endif - } } void free_fair_sched_group(struct task_group *tg) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/