public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Quentin Perret <qperret@google.com>
To: Qais Yousef <qais.yousef@arm.com>
Cc: mingo@redhat.com, peterz@infradead.org,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rickyiu@google.com, wvw@google.com, patrick.bellasi@matbug.net,
	linux-kernel@vger.kernel.org, kernel-team@android.com
Subject: Re: [PATCH] sched: Fix UCLAMP_FLAG_IDLE setting
Date: Thu, 10 Jun 2021 10:27:32 +0000	[thread overview]
Message-ID: <YMHpFObpW/VzrTW3@google.com> (raw)
In-Reply-To: <20210610100039.2gvnl3lu6o2hu5yj@e107158-lin.cambridge.arm.com>

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@google.com>
> > Signed-off-by: Quentin Perret <qperret@google.com>
> > ---
> 
> With the commit message fixed.

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

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


Thanks!
Quentin

      reply	other threads:[~2021-06-10 10:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 14:33 [PATCH] sched: Fix UCLAMP_FLAG_IDLE setting Quentin Perret
2021-06-09 14:37 ` Quentin Perret
2021-06-10 10:00 ` Qais Yousef
2021-06-10 10:27   ` Quentin Perret [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YMHpFObpW/VzrTW3@google.com \
    --to=qperret@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=patrick.bellasi@matbug.net \
    --cc=peterz@infradead.org \
    --cc=qais.yousef@arm.com \
    --cc=rickyiu@google.com \
    --cc=vincent.guittot@linaro.org \
    --cc=wvw@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox