All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Fix asym_fits_capacity() task_util type
@ 2021-11-18 11:01 Vincent Donnefort
  2021-11-18 13:54 ` Vincent Guittot
  0 siblings, 1 reply; 2+ messages in thread
From: Vincent Donnefort @ 2021-11-18 11:01 UTC (permalink / raw)
  To: peterz, mingo, vincent.guittot
  Cc: linux-kernel, dietmar.eggemann, valentin.schneider, Vincent Donnefort

task_util is an unsigned long value, compared with a CPU capacity which is
unsigned long as well. There's no need for an intermidiate implicit int
cast.

Fixes: b4c9c9f15649 ("sched/fair: Prefer prev cpu in asymmetric wakeup path")
Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 945d987246c5..8fde6e10e24b 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6346,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));
-- 
2.25.1


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

* Re: [PATCH] sched/fair: Fix asym_fits_capacity() task_util type
  2021-11-18 11:01 [PATCH] sched/fair: Fix asym_fits_capacity() task_util type Vincent Donnefort
@ 2021-11-18 13:54 ` Vincent Guittot
  0 siblings, 0 replies; 2+ messages in thread
From: Vincent Guittot @ 2021-11-18 13:54 UTC (permalink / raw)
  To: Vincent Donnefort
  Cc: peterz, mingo, linux-kernel, dietmar.eggemann, Valentin.Schneider

On Thu, 18 Nov 2021 at 12:02, Vincent Donnefort
<vincent.donnefort@arm.com> wrote:
>
> task_util is an unsigned long value, compared with a CPU capacity which is
> unsigned long as well. There's no need for an intermidiate implicit int

s/intermidiate/intermediate/

> cast.

I can't remember how I end up using int instead of unsigned long

Side note: similarly task_fits_capacity uses long instead of unsigned
long for cpu's capacity parameter

>
> Fixes: b4c9c9f15649 ("sched/fair: Prefer prev cpu in asymmetric wakeup path")
> Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>

Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>

>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 945d987246c5..8fde6e10e24b 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -6346,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));
> --
> 2.25.1
>

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

end of thread, other threads:[~2021-11-18 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 11:01 [PATCH] sched/fair: Fix asym_fits_capacity() task_util type Vincent Donnefort
2021-11-18 13:54 ` Vincent Guittot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.