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]
Date:   Thu, 10 Jun 2021 10:27:32 +0000
From:   Quentin Perret <qperret@...gle.com>
To:     Qais Yousef <qais.yousef@....com>
Cc:     mingo@...hat.com, peterz@...radead.org, vincent.guittot@...aro.org,
        dietmar.eggemann@....com, rickyiu@...gle.com, wvw@...gle.com,
        patrick.bellasi@...bug.net, linux-kernel@...r.kernel.org,
        kernel-team@...roid.com
Subject: Re: [PATCH] sched: Fix UCLAMP_FLAG_IDLE setting

On Thursday 10 Jun 2021 at 11:00:39 (+0100), Qais Yousef wrote:
> On 06/09/21 14:33, Quentin Perret wrote:
> > The UCLAMP_FLAG_IDLE flag is set on a runqueue when dequeueing the last
> > active task to maintain the last uclamp.max and prevent blocked util
> > from suddenly becoming visible.
> > 
> > However, there is an asymmetry in how the flag is set and cleared which
> > can lead to having the flag set whilst there are active task on the rq.
> > Specifically, the flag is set in the uclamp_rq_inc() path, which is
> > called at enqueue time, but cleared in the uclamp_rq_dec_id() which is
> 
> It is actually the other way around. It is cleared in uclamp_rq_inc() and
> set in uclamp_rq_dec_id().
> 
> > called both when dequeueing and task _and_ during cgroup migrations.
> 
> Is it cgroup migrations or when cgroup uclamp values are updated you mean?
> 
> It is worth being direct and mention that uclamp_update_active() will perform
> uclamp_rq_dec/inc_id() when the cgroup uclamp values are updated, which would
> end up with the flag set but not cleared in this path.

Yep, that's the problematic path.

> > 
> > Fix this by setting the flag in the uclamp_rq_inc_id() path to ensure
> > things remain symmetrical.
> > 
> > Reported-by: Rick Yiu <rickyiu@...gle.com>
> > Signed-off-by: Quentin Perret <qperret@...gle.com>
> > ---
> 
> With the commit message fixed.

Ack, this commit message is a mess, I'll rewrite.

> Reviewed-by: Qais Yousef <qais.yousef@....com>


Thanks!
Quentin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ