mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hongyan Xia <hongyan.xia2@arm.com>
To: Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <vschneid@redhat.com>
Cc: Qais Yousef <qyousef@layalina.io>,
	Morten Rasmussen <morten.rasmussen@arm.com>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Christian Loehle <christian.loehle@arm.com>,
	pierre.gondois@arm.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v3 2/6] sched/uclamp: Track a new util_avg_bias signal
Date: Mon, 10 Jun 2024 16:29:08 +0100	[thread overview]
Message-ID: <da0b9016-379b-4e4f-9741-5f69189661b9@arm.com> (raw)
In-Reply-To: <1b36141c-1ad7-4c34-b293-92003f473465@arm.com>

On 28/05/2024 12:09, Hongyan Xia wrote:
> On 26/05/2024 23:52, Dietmar Eggemann wrote:
>[...]
>>> +    old = READ_ONCE(p->se.avg.util_avg_bias);
>>> +    new = (int)clamp(util, uclamp_min, uclamp_max) - (int)util;
>>> +
>>> +    WRITE_ONCE(p->se.avg.util_avg_bias, new);
>>> +    if (!p->se.on_rq)
>>> +        return;
>>> +    WRITE_ONCE(avg->util_avg_bias, READ_ONCE(avg->util_avg_bias) + 
>>> new - old);
>>> +}
>>> +#else /* !CONFIG_UCLAMP_TASK */
>>> +static void update_util_bias(struct sched_avg *avg, struct 
>>> task_struct *p)
>>> +{
>>> +}
>>> +#endif
>>> +
>>>   /*
>>>    * sched_entity:
>>>    *
>>> @@ -296,6 +330,8 @@ int __update_load_avg_blocked_se(u64 now, struct 
>>> sched_entity *se)
>>>   {
>>>       if (___update_load_sum(now, &se->avg, 0, 0, 0)) {
>>>           ___update_load_avg(&se->avg, se_weight(se));
>>> +        if (entity_is_task(se))
>>> +            update_util_bias(NULL, task_of(se));
>>
>> IMHO,
>>
>> update_util_bias(struct sched_avg *avg, struct sched_entity *se)
>>
>>      if (!entity_is_task(se))
>>          return;
>>
>>      ...
>>
>> would be easier to read.
> 
> Yeah, that would work, and might be a good way to prepare for group 
> clamping if it ever becomes a thing.
> 

Sadly it's not as easy as I hoped. The problem is that we need to fetch 
task uclamp values here so we need to get p anyway. Also, even if one 
day we implement group uclamp, we need to fetch the cfs_rq this se is on 
instead of the whole rq, so the function signature needs to change 
anyway. Keeping it the current way might be the better thing to do here.

> [...]

  reply	other threads:[~2024-06-10 15:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 12:50 [RFC PATCH v3 0/6] Uclamp sum aggregation Hongyan Xia
2024-05-07 12:50 ` [RFC PATCH v3 1/6] Revert "sched/uclamp: Set max_spare_cap_cpu even if max_spare_cap is 0" Hongyan Xia
2024-05-07 12:50 ` [RFC PATCH v3 2/6] sched/uclamp: Track a new util_avg_bias signal Hongyan Xia
2024-05-26 22:52   ` Dietmar Eggemann
2024-05-28 11:09     ` Hongyan Xia
2024-06-10 15:29       ` Hongyan Xia [this message]
2024-05-07 12:50 ` [RFC PATCH v3 3/6] sched/fair: Use util biases for utilization and frequency Hongyan Xia
2024-05-26 22:52   ` Dietmar Eggemann
2024-05-28 11:38     ` Hongyan Xia
2024-05-07 12:50 ` [RFC PATCH v3 4/6] sched/uclamp: Remove all uclamp bucket logic Hongyan Xia
2024-05-07 12:50 ` [RFC PATCH v3 5/6] sched/uclamp: Simplify uclamp_eff_value() Hongyan Xia
2024-05-26 22:52   ` Dietmar Eggemann
2024-05-28 11:42     ` Hongyan Xia
2024-05-07 12:50 ` [RFC PATCH v3 6/6] Propagate negative bias Hongyan Xia
2024-05-26 22:53   ` Dietmar Eggemann
2024-05-28 11:53     ` Hongyan Xia

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=da0b9016-379b-4e4f-9741-5f69189661b9@arm.com \
    --to=hongyan.xia2@arm.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=christian.loehle@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=pierre.gondois@arm.com \
    --cc=qyousef@layalina.io \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.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

all inboxes | Powered by JetHome®