mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3] sched/fair: cleanup task_util and capacity type
@ 2021-12-07  9:57 Vincent Donnefort
  2021-12-07 14:59 ` Peter Zijlstra
  2021-12-08 21:27 ` [tip: sched/core] sched/fair: Cleanup " tip-bot2 for Vincent Donnefort
  0 siblings, 2 replies; 3+ messages in thread
From: Vincent Donnefort @ 2021-12-07  9:57 UTC (permalink / raw)
  To: peterz, mingo, vincent.guittot
  Cc: linux-kernel, dietmar.eggemann, valentin.schneider, Vincent Donnefort

task_util and capacity are comparable unsigned long values. There is no
need for an intermidiate implicit signed cast.

Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>

---
v2 -> v3:
  * Drop "Fixes" tags. 
  * Merge changes in one.

v1 -> v2:
  * Add task_fits_capacity missing unsigned
---

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 945d987246c5..26a88975f68a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4070,7 +4070,8 @@ static inline void util_est_update(struct cfs_rq *cfs_rq,
 	trace_sched_util_est_se_tp(&p->se);
 }
 
-static inline int task_fits_capacity(struct task_struct *p, long capacity)
+static inline int task_fits_capacity(struct task_struct *p,
+				     unsigned long capacity)
 {
 	return fits_capacity(uclamp_task_util(p), capacity);
 }
@@ -6346,7 +6347,7 @@ select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target)
 	return best_cpu;
 }
 
-static inline bool asym_fits_capacity(int task_util, int cpu)
+static inline bool asym_fits_capacity(unsigned long task_util, int cpu)
 {
 	if (static_branch_unlikely(&sched_asym_cpucapacity))
 		return fits_capacity(task_util, capacity_of(cpu));
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] sched/fair: cleanup task_util and capacity type
  2021-12-07  9:57 [PATCH v3] sched/fair: cleanup task_util and capacity type Vincent Donnefort
@ 2021-12-07 14:59 ` Peter Zijlstra
  2021-12-08 21:27 ` [tip: sched/core] sched/fair: Cleanup " tip-bot2 for Vincent Donnefort
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Zijlstra @ 2021-12-07 14:59 UTC (permalink / raw)
  To: Vincent Donnefort
  Cc: mingo, vincent.guittot, linux-kernel, dietmar.eggemann,
	valentin.schneider

On Tue, Dec 07, 2021 at 09:57:55AM +0000, Vincent Donnefort wrote:
> task_util and capacity are comparable unsigned long values. There is no
> need for an intermidiate implicit signed cast.
> 
> Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: sched/core] sched/fair: Cleanup task_util and capacity type
  2021-12-07  9:57 [PATCH v3] sched/fair: cleanup task_util and capacity type Vincent Donnefort
  2021-12-07 14:59 ` Peter Zijlstra
@ 2021-12-08 21:27 ` tip-bot2 for Vincent Donnefort
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Vincent Donnefort @ 2021-12-08 21:27 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Vincent Donnefort, Peter Zijlstra (Intel), x86, linux-kernel

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     ef8df9798d469b7c45c66664550e93469749f1e8
Gitweb:        https://git.kernel.org/tip/ef8df9798d469b7c45c66664550e93469749f1e8
Author:        Vincent Donnefort <vincent.donnefort@arm.com>
AuthorDate:    Tue, 07 Dec 2021 09:57:55 
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 08 Dec 2021 22:22:02 +01:00

sched/fair: Cleanup task_util and capacity type

task_util and capacity are comparable unsigned long values. There is no
need for an intermidiate implicit signed cast.

Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20211207095755.859972-1-vincent.donnefort@arm.com
---
 kernel/sched/fair.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f34f2f3..ac5e554 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4070,7 +4070,8 @@ done:
 	trace_sched_util_est_se_tp(&p->se);
 }
 
-static inline int task_fits_capacity(struct task_struct *p, long capacity)
+static inline int task_fits_capacity(struct task_struct *p,
+				     unsigned long capacity)
 {
 	return fits_capacity(uclamp_task_util(p), capacity);
 }
@@ -6345,7 +6346,7 @@ select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target)
 	return best_cpu;
 }
 
-static inline bool asym_fits_capacity(int task_util, int cpu)
+static inline bool asym_fits_capacity(unsigned long task_util, int cpu)
 {
 	if (static_branch_unlikely(&sched_asym_cpucapacity))
 		return fits_capacity(task_util, capacity_of(cpu));

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-08 21:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07  9:57 [PATCH v3] sched/fair: cleanup task_util and capacity type Vincent Donnefort
2021-12-07 14:59 ` Peter Zijlstra
2021-12-08 21:27 ` [tip: sched/core] sched/fair: Cleanup " tip-bot2 for Vincent Donnefort

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®