From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754234AbbIMLAA (ORCPT ); Sun, 13 Sep 2015 07:00:00 -0400 Received: from terminus.zytor.com ([198.137.202.10]:43328 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751885AbbIMK76 (ORCPT ); Sun, 13 Sep 2015 06:59:58 -0400 Date: Sun, 13 Sep 2015 03:59:23 -0700 From: tip-bot for Byungchul Park Message-ID: Cc: byungchul.park@lge.com, hpa@zytor.com, peterz@infradead.org, torvalds@linux-foundation.org, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, efault@gmx.de Reply-To: mingo@kernel.org, efault@gmx.de, linux-kernel@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, byungchul.park@lge.com, hpa@zytor.com In-Reply-To: <1440069720-27038-4-git-send-email-byungchul.park@lge.com> References: <1440069720-27038-4-git-send-email-byungchul.park@lge.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/fair: Have task_move_group_fair() also detach entity load from the old runqueue Git-Commit-ID: 1746babbb15594ba2d8d8196589bbbc2b5ff51c9 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 1746babbb15594ba2d8d8196589bbbc2b5ff51c9 Gitweb: http://git.kernel.org/tip/1746babbb15594ba2d8d8196589bbbc2b5ff51c9 Author: Byungchul Park AuthorDate: Thu, 20 Aug 2015 20:21:58 +0900 Committer: Ingo Molnar CommitDate: Sun, 13 Sep 2015 09:52:47 +0200 sched/fair: Have task_move_group_fair() also detach entity load from the old runqueue Since we attach the entity load to the new runqueue, we should also detatch the entity load from the old runqueue, otherwise load can accumulate. Signed-off-by: Byungchul Park [ Rewrote the changelog. ] Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: yuyang.du@intel.com Link: http://lkml.kernel.org/r/1440069720-27038-4-git-send-email-byungchul.park@lge.com Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 959b2ea..1e1fe7f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8037,8 +8037,12 @@ static void task_move_group_fair(struct task_struct *p, int queued) if (!queued && (!se->sum_exec_runtime || p->state == TASK_WAKING)) queued = 1; + cfs_rq = cfs_rq_of(se); if (!queued) - se->vruntime -= cfs_rq_of(se)->min_vruntime; + se->vruntime -= cfs_rq->min_vruntime; + + /* Synchronize task with its prev cfs_rq */ + detach_entity_load_avg(cfs_rq, se); set_task_rq(p, task_cpu(p)); se->depth = se->parent ? se->parent->depth + 1 : 0; cfs_rq = cfs_rq_of(se);