linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Xuewen Yan <xuewen.yan94@gmail.com>
Cc: Vincent Donnefort <vincent.donnefort@arm.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Patrick Bellasi <patrick.bellasi@matbug.net>,
	Quentin Perret <qperret@google.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched/fair: Fix util_est UTIL_AVG_UNCHANGED handling
Date: Fri, 28 May 2021 00:38:11 +0200	[thread overview]
Message-ID: <a8ab9455-a9be-2349-d23a-676aa89fbf2d@arm.com> (raw)
In-Reply-To: <CAB8ipk8POOzM2Dut0gcqsgNO0r2585GGv4SG+a1mOmMnrW=Vrw@mail.gmail.com>

On 27/05/2021 07:41, Xuewen Yan wrote:
> Hi
> 
> On Wed, May 26, 2021 at 10:59 PM Dietmar Eggemann
> <dietmar.eggemann@arm.com> wrote:
>>
>> On 19/05/2021 18:06, Vincent Donnefort wrote:
>>> On Fri, May 14, 2021 at 12:37:48PM +0200, Dietmar Eggemann wrote:

[...]

>> diff --git a/include/linux/sched.h b/include/linux/sched.h
>> index c7e7d50e2fdc..0a0bca694536 100644
>> --- a/include/linux/sched.h
>> +++ b/include/linux/sched.h
>> @@ -357,6 +357,16 @@ struct util_est {
>>  #define UTIL_EST_WEIGHT_SHIFT          2
>>  } __attribute__((__aligned__(sizeof(u64))));
>>
>> +/*
>> + * This flag is used to synchronize util_est with util_avg updates.
>> + * When a task is dequeued, its util_est should not be updated if its util_avg
>> + * has not been updated in the meantime.
>> + * This information is mapped into the MSB bit of util_est.enqueued at dequeue
>> + * time. Since max value of util_est.enqueued for a task is 1024 (PELT util_avg
>> + * for a task) it is safe to use MSB.
>> + */
>> +#define UTIL_AVG_UNCHANGED 0x80000000
>> +
> 
> IMHO, Maybe it would be better to put it in the util_est structure
> just like UTIL_EST_WEIGHT_SHIFT?

Yeah, can do.

I just realized that 'kernel/sched/pelt.h' does not include
<linux/sched.h> directly (or indirectly via "sched.h". But I can easily
move cfs_se_util_change() (which uses UTIL_AVG_UNCHANGED) from pelt.h to
pelt.c, its only consumer anyway.

  reply	other threads:[~2021-05-27 22:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 10:37 [PATCH] sched/fair: Fix util_est UTIL_AVG_UNCHANGED handling Dietmar Eggemann
2021-05-19 16:06 ` Vincent Donnefort
2021-05-26 14:59   ` Dietmar Eggemann
2021-05-27  5:41     ` Xuewen Yan
2021-05-27 22:38       ` Dietmar Eggemann [this message]
2021-05-28  6:25         ` Xuewen Yan
2021-06-02 14:58           ` Dietmar Eggemann

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=a8ab9455-a9be-2349-d23a-676aa89fbf2d@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=patrick.bellasi@matbug.net \
    --cc=peterz@infradead.org \
    --cc=qperret@google.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.donnefort@arm.com \
    --cc=vincent.guittot@linaro.org \
    --cc=xuewen.yan94@gmail.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;
as well as URLs for NNTP newsgroup(s).