Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934408AbeAJMTJ (ORCPT + 1 other); Wed, 10 Jan 2018 07:19:09 -0500 Received: from terminus.zytor.com ([65.50.211.136]:46515 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932430AbeAJMTF (ORCPT ); Wed, 10 Jan 2018 07:19:05 -0500 Date: Wed, 10 Jan 2018 04:14:16 -0800 From: tip-bot for Patrick Bellasi Message-ID: Cc: dietmar.eggemann@arm.com, tkjos@android.com, patrick.bellasi@arm.com, torvalds@linux-foundation.org, tglx@linutronix.de, juri.lelli@redhat.com, pjt@google.com, vincent.guittot@linaro.org, mingo@kernel.org, morten.rasmussen@arm.com, chris.redpath@arm.com, rafael.j.wysocki@intel.com, joelaf@google.com, peterz@infradead.org, brendan.jackman@arm.com, hpa@zytor.com, linux-kernel@vger.kernel.org, viresh.kumar@linaro.org Reply-To: tkjos@android.com, dietmar.eggemann@arm.com, mingo@kernel.org, vincent.guittot@linaro.org, juri.lelli@redhat.com, pjt@google.com, torvalds@linux-foundation.org, tglx@linutronix.de, patrick.bellasi@arm.com, brendan.jackman@arm.com, peterz@infradead.org, joelaf@google.com, rafael.j.wysocki@intel.com, chris.redpath@arm.com, morten.rasmussen@arm.com, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, hpa@zytor.com In-Reply-To: <20171205171018.9203-2-patrick.bellasi@arm.com> References: <20171205171018.9203-2-patrick.bellasi@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/fair: Use 'unsigned long' for utilization, consistently Git-Commit-ID: f01415fdbfe83380c2dfcf90b7b26042f88963aa 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 Return-Path: Commit-ID: f01415fdbfe83380c2dfcf90b7b26042f88963aa Gitweb: https://git.kernel.org/tip/f01415fdbfe83380c2dfcf90b7b26042f88963aa Author: Patrick Bellasi AuthorDate: Tue, 5 Dec 2017 17:10:15 +0000 Committer: Ingo Molnar CommitDate: Wed, 10 Jan 2018 11:30:28 +0100 sched/fair: Use 'unsigned long' for utilization, consistently Utilization and capacity are tracked as 'unsigned long', however some functions using them return an 'int' which is ultimately assigned back to 'unsigned long' variables. Since there is not scope on using a different and signed type, consolidate the signature of functions returning utilization to always use the native type. This change improves code consistency, and it also benefits code paths where utilizations should be clamped by avoiding further type conversions or ugly type casts. Signed-off-by: Patrick Bellasi Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Chris Redpath Reviewed-by: Brendan Jackman Reviewed-by: Dietmar Eggemann Cc: Joel Fernandes Cc: Juri Lelli Cc: Linus Torvalds Cc: Morten Rasmussen Cc: Paul Turner Cc: Peter Zijlstra Cc: Rafael J . Wysocki Cc: Thomas Gleixner Cc: Todd Kjos Cc: Vincent Guittot Cc: Viresh Kumar Link: http://lkml.kernel.org/r/20171205171018.9203-2-patrick.bellasi@arm.com Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2915c0d..de43bd8 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5765,8 +5765,8 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, return affine; } -static inline int task_util(struct task_struct *p); -static int cpu_util_wake(int cpu, struct task_struct *p); +static inline unsigned long task_util(struct task_struct *p); +static unsigned long cpu_util_wake(int cpu, struct task_struct *p); static unsigned long capacity_spare_wake(int cpu, struct task_struct *p) { @@ -6247,7 +6247,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) * capacity_orig) as it useful for predicting the capacity required after task * migrations (scheduler-driven DVFS). */ -static int cpu_util(int cpu) +static unsigned long cpu_util(int cpu) { unsigned long util = cpu_rq(cpu)->cfs.avg.util_avg; unsigned long capacity = capacity_orig_of(cpu); @@ -6255,7 +6255,7 @@ static int cpu_util(int cpu) return (util >= capacity) ? capacity : util; } -static inline int task_util(struct task_struct *p) +static inline unsigned long task_util(struct task_struct *p) { return p->se.avg.util_avg; } @@ -6264,7 +6264,7 @@ static inline int task_util(struct task_struct *p) * cpu_util_wake: Compute cpu utilization with any contributions from * the waking task p removed. */ -static int cpu_util_wake(int cpu, struct task_struct *p) +static unsigned long cpu_util_wake(int cpu, struct task_struct *p) { unsigned long util, capacity;