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]
Message-ID: <CAKfTPtCNjT8FKUF3=vAR6sa7pagvgHS5997KbUs9fGzr77unWA@mail.gmail.com>
Date:   Fri, 15 Nov 2019 09:02:12 +0100
From:   Vincent Guittot <vincent.guittot@...aro.org>
To:     Qais Yousef <qais.yousef@....com>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Patrick Bellasi <patrick.bellasi@...bug.net>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sched/core: uclamp: fix wrong condition

On Thu, 14 Nov 2019 at 22:10, Qais Yousef <qais.yousef@....com> wrote:
>
> uclamp_update_active() should perform the update when
> p->uclamp[clamp_id].active is true. But when the logic was inverted in
> [1], the if condition wasn't inverted correctly too.
>
> [1] https://lore.kernel.org/lkml/20190902073836.GO2369@hirez.programming.kicks-ass.net/
>
> Fixes: babbe170e053 ("sched/uclamp: Update CPU's refcount on TG's clamp changes")
> Reported-by: Suren Baghdasaryan <surenb@...gle.com>
> Signed-off-by: Qais Yousef <qais.yousef@....com>
> CC: Juri Lelli <juri.lelli@...hat.com>
> CC: Vincent Guittot <vincent.guittot@...aro.org>
> CC: Dietmar Eggemann <dietmar.eggemann@....com>
> CC: Steven Rostedt <rostedt@...dmis.org>
> CC: Ben Segall <bsegall@...gle.com>
> CC: Mel Gorman <mgorman@...e.de>
> CC: Patrick Bellasi <patrick.bellasi@...bug.net>
> CC: linux-kernel@...r.kernel.org

Acked-by: Vincent Guittot <vincent.guittot@...aro.org>

> ---
>  kernel/sched/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 0f2eb3629070..2de53489c909 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -1065,7 +1065,7 @@ uclamp_update_active(struct task_struct *p, enum uclamp_id clamp_id)
>          * affecting a valid clamp bucket, the next time it's enqueued,
>          * it will already see the updated clamp bucket value.
>          */
> -       if (!p->uclamp[clamp_id].active) {
> +       if (p->uclamp[clamp_id].active) {
>                 uclamp_rq_dec_id(rq, p, clamp_id);
>                 uclamp_rq_inc_id(rq, p, clamp_id);
>         }
> --
> 2.17.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ