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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Nov 2018 15:41:42 +0100
From:   Vincent Guittot <vincent.guittot@...aro.org>
To:     andrea.parri@...rulasolutions.com
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] sched/fair: Clean up comment in nohz_idle_balance()

On Tue, 27 Nov 2018 at 12:01, Andrea Parri
<andrea.parri@...rulasolutions.com> wrote:
>
> Concerning the comment associated to the atomic_fetch_andnot() in
> nohz_idle_balance(), Vincent explains [1]:
>
>   "[...] the comment is useless and can be removed [...]  it was
>    referring to a line code above the comment that was present in
>    a previous iteration of the patchset. This line disappeared in
>    final version but the comment has stayed."
>
> So remove the comment.
>
> Vincent also points out that the full ordering associated to the
> atomic_fetch_andnot() primitive could be relaxed, but this patch
> insists on the current more conservative/fully ordered solution:
>
> "Performance" isn't a concern, stay away from "correctness"/subtle
> relaxed (re)ordering if possible..., just make sure not to confuse
> the next reader with misleading/out-of-date comments.
>
> [1] http://lkml.kernel.org/r/CAKfTPtBjA-oCBRkO6__npQwL3+HLjzk7riCcPU1R7YdO-EpuZg@mail.gmail.com
>
> Suggested-by: Vincent Guittot <vincent.guittot@...aro.org>
> Signed-off-by: Andrea Parri <andrea.parri@...rulasolutions.com>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Vincent Guittot <vincent.guittot@...aro.org>

Looks good to me

> ---
>  kernel/sched/fair.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index ac855b2f47746..db514993565b2 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -9533,9 +9533,7 @@ static bool nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle)
>                 return false;
>         }
>
> -       /*
> -        * barrier, pairs with nohz_balance_enter_idle(), ensures ...
> -        */
> +       /* could be _relaxed() */
>         flags = atomic_fetch_andnot(NOHZ_KICK_MASK, nohz_flags(this_cpu));
>         if (!(flags & NOHZ_KICK_MASK))
>                 return false;
> --
> 2.17.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ