Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754249AbdGNNVS (ORCPT ); Fri, 14 Jul 2017 09:21:18 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:36590 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754162AbdGNNVP (ORCPT ); Fri, 14 Jul 2017 09:21:15 -0400 From: Josef Bacik To: mingo@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org, umgwanakikbuti@gmail.com, tj@kernel.org, kernel-team@fb.com Cc: Josef Bacik Subject: [PATCH 4/7] sched/fair: don't include effective load of process in the old cpu load Date: Fri, 14 Jul 2017 13:21:01 +0000 Message-Id: <1500038464-8742-5-git-send-email-josef@toxicpanda.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1500038464-8742-1-git-send-email-josef@toxicpanda.com> References: <1500038464-8742-1-git-send-email-josef@toxicpanda.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 945 Lines: 27 From: Josef Bacik We have no idea how long ago the process went to sleep. It could have just gone to sleep, in which case we would essentially be counting the load of the process twice in the previous effective load. Since the history presumably already exists in the previous cpu load don't bother adding it's effective load again. Signed-off-by: Josef Bacik --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d958634..ee8dced 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5689,7 +5689,7 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, this_eff_load *= this_load + effective_load(tg, this_cpu, weight, weight); - prev_eff_load *= load + effective_load(tg, prev_cpu, 0, weight); + prev_eff_load *= load; } balanced = this_eff_load <= prev_eff_load; -- 2.9.3