From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Chen Yu <yu.c.chen@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Valentin Schneider <vschneid@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Juri Lelli <juri.lelli@redhat.com>,
Swapnil Sapkal <Swapnil.Sapkal@amd.com>,
Aaron Lu <aaron.lu@intel.com>, Tim Chen <tim.c.chen@intel.com>,
K Prateek Nayak <kprateek.nayak@amd.com>,
"Gautham R . Shenoy" <gautham.shenoy@amd.com>,
x86@kernel.org
Subject: Re: [RFC PATCH] sched/fair: Introduce WAKEUP_BIAS_PREV_IDLE to reduce migrations
Date: Mon, 16 Oct 2023 15:24:45 -0400 [thread overview]
Message-ID: <be4f14be-0872-420d-9639-ad64961f7477@efficios.com> (raw)
In-Reply-To: <ZSwI4UTrXLNEWwKM@chenyu5-mobl2.ccr.corp.intel.com>
On 2023-10-15 11:44, Chen Yu wrote:
> On 2023-10-12 at 16:36:26 -0400, Mathieu Desnoyers wrote:
>> Introduce the WAKEUP_BIAS_PREV_IDLE scheduler feature to reduce the
>> task migration rate.
>>
>> For scenarios where the system is under-utilized (CPUs are partly idle),
>> eliminate frequent task migrations from almost idle CPU to completely
>> idle CPUs by introducing a bias towards the previous CPU if it is idle
>> or almost idle in select_idle_sibling(). Use 1% of the CPU capacity
>> of the previously used CPU as CPU utilization "almost idle" cutoff.
>>
>> +
>> +/*
>> + * A runqueue is considered almost idle if:
>> + *
>> + * cpu_util_without(cpu, p) / 1024 <= 1% * capacity_of(cpu)
>
> util_avg is in the range [0:1024], thus cpu_util_without(cpu, p) / 1024
> is <= 1, and 1% * cap is 10, so 1 <= 10 is always true.
> I suppose you want to compare:
> (cpu_util_without(cpu, p) / capacity_orig_of(cpu)) <= 1% ->
> cpu_util_without(cpu, p) * 100 <= capacity_orig_of(cpu) ?
Good point!
Now that I have fixed this, I come back to a situation where:
- load_avg works, probably because it multiplies by the weight, and
therefore when there are few tasks on the runqueue it reflects the fact
that the runqueue is almost idle. Even though it happens to work, it
does not appear to be an elegant solution.
- util_avg and runnable_avg do not work. Probably because they take into
account both running/runnable and recently blocked tasks, so they cannot
be used to provide a clear picture of the very-short-term idleness
status for the purpose of selecting a prev rq.
I wonder if there are any rq stats I can use which do not include
recently blocked tasks ?
Thanks,
Mathieu
>
> thanks,
> Chenyu
>
>
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
prev parent reply other threads:[~2023-10-16 19:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-12 20:36 Mathieu Desnoyers
2023-10-15 15:44 ` Chen Yu
2023-10-16 19:24 ` Mathieu Desnoyers [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=be4f14be-0872-420d-9639-ad64961f7477@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=Swapnil.Sapkal@amd.com \
--cc=aaron.lu@intel.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=gautham.shenoy@amd.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tim.c.chen@intel.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=x86@kernel.org \
--cc=yu.c.chen@intel.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®