From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932348AbcI3L4t (ORCPT ); Fri, 30 Sep 2016 07:56:49 -0400 Received: from terminus.zytor.com ([198.137.202.10]:44614 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932252AbcI3L4k (ORCPT ); Fri, 30 Sep 2016 07:56:40 -0400 Date: Fri, 30 Sep 2016 04:55:57 -0700 From: tip-bot for Dietmar Eggemann Message-ID: Cc: tglx@linutronix.de, hpa@zytor.com, peterz@infradead.org, efault@gmx.de, torvalds@linux-foundation.org, mingo@kernel.org, dietmar.eggemann@arm.com, linux-kernel@vger.kernel.org Reply-To: hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, dietmar.eggemann@arm.com, peterz@infradead.org, efault@gmx.de, torvalds@linux-foundation.org In-Reply-To: <1471874441-24701-1-git-send-email-dietmar.eggemann@arm.com> References: <1471874441-24701-1-git-send-email-dietmar.eggemann@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/fair: Fix fixed point arithmetic width for shares and effective load Git-Commit-ID: ab522e33f91799661aad47bebb691f241a9f6bb8 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: ab522e33f91799661aad47bebb691f241a9f6bb8 Gitweb: http://git.kernel.org/tip/ab522e33f91799661aad47bebb691f241a9f6bb8 Author: Dietmar Eggemann AuthorDate: Mon, 22 Aug 2016 15:00:41 +0100 Committer: Ingo Molnar CommitDate: Fri, 30 Sep 2016 10:53:19 +0200 sched/fair: Fix fixed point arithmetic width for shares and effective load Since commit: 2159197d6677 ("sched/core: Enable increased load resolution on 64-bit kernels") we now have two different fixed point units for load: - 'shares' in calc_cfs_shares() has 20 bit fixed point unit on 64-bit kernels. Therefore use scale_load() on MIN_SHARES. - 'wl' in effective_load() has 10 bit fixed point unit. Therefore use scale_load_down() on tg->shares which has 20 bit fixed point unit on 64-bit kernels. Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1471874441-24701-1-git-send-email-dietmar.eggemann@arm.com Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8fb4d19..786ef94 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5017,9 +5017,9 @@ static long effective_load(struct task_group *tg, int cpu, long wl, long wg) * wl = S * s'_i; see (2) */ if (W > 0 && w < W) - wl = (w * (long)tg->shares) / W; + wl = (w * (long)scale_load_down(tg->shares)) / W; else - wl = tg->shares; + wl = scale_load_down(tg->shares); /* * Per the above, wl is the new se->load.weight value; since