From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Qais Yousef <qais.yousef@arm.com>,
Valentin Schneider <valentin.schneider@arm.com>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/uclamp: Fix rq->uclamp_max not set on first enqueue
Date: Wed, 1 Dec 2021 10:20:24 +0100 [thread overview]
Message-ID: <296f08f4-f229-ec83-5dae-b8b499b81d49@arm.com> (raw)
In-Reply-To: <20211130154116.w5wjtbc4shpwcoku@e107158-lin.cambridge.arm.com>
On 30.11.21 16:41, Qais Yousef wrote:
> On 11/30/21 12:29, Valentin Schneider wrote:
>> On 30/11/21 11:23, Qais Yousef wrote:
>>> Hi Valentin
>>>
>>> On 11/26/21 10:51, Valentin Schneider wrote:
>>>> On 25/11/21 16:52, Qais Yousef wrote:
>>>>> Commit d81ae8aac85c ("sched/uclamp: Fix initialization of struct
>>>>> uclamp_rq") introduced a bug where uclamp_max of the rq is not reset to
>>>>> match the woken up task's uclamp_max when the rq is idle. This only
>>>>> impacts the first wake up after enabling the static key. And it only
LGTM.
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Tested with rt-app:
"tasks": {
"task_n1": {
"util_min": 0,
"util_max": 369,
"loop": 1,
"phases": {
"p000001": {
"loop": 5,
"run": 800,
"timer": {
"period": 16000,
"ref": "task_n1"
}
}
},
"policy": "SCHED_OTHER"
}
}
w/o patch:
/* missing (1) since rq->uclamp_flags = UCLAMP_FLAG_IDLE is not set initially */
[75.002086] (3) uclamp_rq_inc_id() CPU5 p=[task_n1-0 1693] uc_se->value=369 uc_rq->value=1024
/* first dequeue to _uclamp_ idle set UCLAMP_FLAG_IDLE */
[75.013851] (2) uclamp_idle_value() CPU5 p=[task_n1-0 1693] clamp_id=1 value=369
[75.017972] (1) uclamp_idle_reset() CPU5 p=[task_n1-0 1693] clamp_id=0 value=0
/* UCLAMP_FLAG_IDLE is set -> set rq->uclamp[UCLAMP_MAX].value to *369* */
[75.017984] (1) uclamp_idle_reset() CPU5 p=[task_n1-0 1693] clamp_id=1 value=369
[75.017995] (3) uclamp_rq_inc_id() CPU5 p=[task_n1-0 1693] uc_se->value=369 uc_rq->value=*369*
w/ patch:
[63.393974] (1) uclamp_idle_reset() CPU5 p=[task_n1-0 1700] clamp_id=0 value=0
/* UCLAMP_FLAG_IDLE is set -> set rq->uclamp[UCLAMP_MAX].value to *369* */
[63.401269] (1) uclamp_idle_reset() CPU5 p=[task_n1-0 1700] clamp_id=1 value=369
[63.415513] (3) uclamp_rq_inc_id() CPU5 p=[task_n1-0 1700] uc_se->value=369 uc_rq->value=*369*
/* first dequeue to _uclamp_ idle set UCLAMP_FLAG_IDLE (again) */
[63.434781] (2) uclamp_idle_value() CPU5 p=[task_n1-0 1700] clamp_id=1 value=369
[63.449681] (1) uclamp_idle_reset() CPU5 p=[task_n1-0 1700] clamp_id=0 value=0
[63.449691] (1) uclamp_idle_reset() CPU5 p=[task_n1-0 1700] clamp_id=1 value=369
[63.449699] (3) uclamp_rq_inc_id() CPU5 p=[task_n1-0 1700] uc_se->value=369 uc_rq->value=369
[...]
next prev parent reply other threads:[~2021-12-01 9:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 16:52 [PATCH] sched/uclamp: Fix rq->uclamp_max not set on first enqueue Qais Yousef
2021-11-26 10:51 ` Valentin Schneider
2021-11-30 11:23 ` Qais Yousef
2021-11-30 12:29 ` Valentin Schneider
2021-11-30 15:41 ` Qais Yousef
2021-12-01 9:20 ` Dietmar Eggemann [this message]
2021-12-02 10:36 ` Qais Yousef
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=296f08f4-f229-ec83-5dae-b8b499b81d49@arm.com \
--to=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=qais.yousef@arm.com \
--cc=valentin.schneider@arm.com \
--cc=vincent.guittot@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).