lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKfTPtAU9t=X8e3WiVh=pd-JwQwCroGz6xiyuj-WwqsEwOcMxA@mail.gmail.com>
Date:   Thu, 18 Nov 2021 14:54:37 +0100
From:   Vincent Guittot <vincent.guittot@...aro.org>
To:     Vincent Donnefort <Vincent.Donnefort@....com>
Cc:     peterz@...radead.org, mingo@...hat.com,
        linux-kernel@...r.kernel.org, dietmar.eggemann@....com,
        Valentin.Schneider@....com
Subject: Re: [PATCH] sched/fair: Fix asym_fits_capacity() task_util type

On Thu, 18 Nov 2021 at 12:02, Vincent Donnefort
<vincent.donnefort@....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@....com>

Reviewed-by: Vincent Guittot <vincent.guittot@...aro.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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ