From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753107AbcEMF3i (ORCPT ); Fri, 13 May 2016 01:29:38 -0400 Received: from mga14.intel.com ([192.55.52.115]:48345 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751322AbcEMF3h (ORCPT ); Fri, 13 May 2016 01:29:37 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,612,1455004800"; d="scan'208";a="965634030" Date: Fri, 13 May 2016 05:48:11 +0800 From: Yuyang Du To: peterz@infradead.org, linux-kernel@vger.kernel.org, efault@gmx.de, mingo@kernel.org, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, vincent.guittot@linaro.org Subject: Re: [tip:sched/core] sched/fair: Correct unit of load_above_capacity Message-ID: <20160512214811.GB8790@intel.com> References: <1461958364-675-4-git-send-email-dietmar.eggemann@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 12, 2016 at 03:31:51AM -0700, tip-bot for Morten Rasmussen wrote: > Commit-ID: cfa10334318d8212d007da8c771187643c9cef35 > Gitweb: http://git.kernel.org/tip/cfa10334318d8212d007da8c771187643c9cef35 > Author: Morten Rasmussen > AuthorDate: Fri, 29 Apr 2016 20:32:40 +0100 > Committer: Ingo Molnar > CommitDate: Thu, 12 May 2016 09:55:33 +0200 > > sched/fair: Correct unit of load_above_capacity > > In calculate_imbalance() load_above_capacity currently has the unit > [capacity] while it is used as being [load/capacity]. Not only is it > wrong it also makes it unlikely that load_above_capacity is ever used > as the subsequent code picks the smaller of load_above_capacity and > the avg_load > > This patch ensures that load_above_capacity has the right unit > [load/capacity]. > > Signed-off-by: Morten Rasmussen > [ Changed changelog to note it was in capacity unit; +rebase. ] > Signed-off-by: Peter Zijlstra (Intel) > Cc: Dietmar Eggemann > Cc: Linus Torvalds > Cc: Mike Galbraith > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Cc: linux-kernel@vger.kernel.org > Link: http://lkml.kernel.org/r/1461958364-675-4-git-send-email-dietmar.eggemann@arm.com > Signed-off-by: Ingo Molnar > --- > kernel/sched/fair.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 2338105..218f8e8 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -7067,9 +7067,11 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s > if (busiest->group_type == group_overloaded && > local->group_type == group_overloaded) { > load_above_capacity = busiest->sum_nr_running * SCHED_CAPACITY_SCALE; > - if (load_above_capacity > busiest->group_capacity) > + if (load_above_capacity > busiest->group_capacity) { > load_above_capacity -= busiest->group_capacity; > - else > + load_above_capacity *= NICE_0_LOAD; > + load_above_capacity /= busiest->group_capacity; > + } else > load_above_capacity = ~0UL; > } Hi Morten, I got the feeling this might be wrong, the NICE_0_LOAD should be scaled down. But I hope I am wrong. Vincent, could you take a look?