From patchwork Wed Aug 10 10:27:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 73684 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp544173qga; Wed, 10 Aug 2016 11:46:43 -0700 (PDT) X-Received: by 10.98.13.84 with SMTP id v81mr9792796pfi.108.1470854803284; Wed, 10 Aug 2016 11:46:43 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si49611106pay.201.2016.08.10.11.46.42; Wed, 10 Aug 2016 11:46:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938705AbcHJSq3 (ORCPT + 27 others); Wed, 10 Aug 2016 14:46:29 -0400 Received: from foss.arm.com ([217.140.101.70]:49397 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936596AbcHJSqY (ORCPT ); Wed, 10 Aug 2016 14:46:24 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C5BA343F; Wed, 10 Aug 2016 03:29:08 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F1B5E3F487; Wed, 10 Aug 2016 03:27:39 -0700 (PDT) From: Dietmar Eggemann To: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org Cc: Morten Rasmussen , Vincent Guittot , Yuyang Du Subject: [PATCH] sched/fair: Fix load_above_capacity fixed point arithmetic width Date: Wed, 10 Aug 2016 11:27:27 +0100 Message-Id: <1470824847-5316-1-git-send-email-dietmar.eggemann@arm.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 2159197d6677 ("sched/core: Enable increased load resolution on 64-bit kernels") we now have two different fixed point units for load. load_above_capacity has to have 10 bit fixed point unit like PELT whereas NICE_0_LOAD has 20 bit fixed point unit on 64-bit kernels. Fix this by scaling down NICE_0_LOAD when multiplying load_above_capacity with it. Signed-off-by: Dietmar Eggemann Acked-by: Morten Rasmussen --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4088eedea763..fe4093807852 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7147,7 +7147,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s load_above_capacity = busiest->sum_nr_running * SCHED_CAPACITY_SCALE; if (load_above_capacity > busiest->group_capacity) { load_above_capacity -= busiest->group_capacity; - load_above_capacity *= NICE_0_LOAD; + load_above_capacity *= scale_load_down(NICE_0_LOAD); load_above_capacity /= busiest->group_capacity; } else load_above_capacity = ~0UL;