From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Chen Yu <yu.c.chen@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Juri Lelli <juri.lelli@redhat.com>,
Tim Chen <tim.c.chen@intel.com>, Aaron Lu <aaron.lu@intel.com>,
Dietmar Eggemann <dietmar.eggemann@arm.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>,
K Prateek Nayak <kprateek.nayak@amd.com>,
"Gautham R . Shenoy" <gautham.shenoy@amd.com>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/2] sched/fair: skip the cache hot CPU in select_idle_cpu()
Date: Tue, 12 Sep 2023 11:18:33 -0400 [thread overview]
Message-ID: <2a47ae82-b8cd-95db-9f48-82b3df0730f3@efficios.com> (raw)
In-Reply-To: <ZQByY4rDvjejRRs5@chenyu5-mobl2.ccr.corp.intel.com>
On 9/12/23 10:14, Chen Yu wrote:
> On 2023-09-12 at 10:06:27 -0400, Mathieu Desnoyers wrote:
[...]
>>
>> One more tweak: given that more than one task can update the cache_hot_timeout forward
>> one after another, and given that some tasks have larger burst_sleep_avg values than
>> others, I suspect we want to keep the forward movement monotonic with something like:
>>
>> if (sched_feat(SIS_CACHE) && task_sleep && !rq->nr_running && p->se.burst_sleep_avg &&
>> rq->cache_hot_timeout < now + p->se.burst_sleep_avg)
>> rq->cache_hot_timeout = now + p->se.burst_sleep_avg;
>>
>
> Yeah, Aaron has mentioned this too:
> https://lore.kernel.org/lkml/ZP7SYu+gxlc%2FYjHu@chenyu5-mobl2/
> May I know the benefit of keeping forward movement monotonic?
> I thought that, should we only honor the latest dequeued task's burst_sleep_avg?
> Because we don't know whether the old deuqued task's cache has been scribbled by the latest
> dequeued task or not, does it still make sense to wake up the old dequeued task on its
> previous CPU?
Here is my reasoning:
If a second task is scheduled after the first dequeued task (a
task with large burst_sleep_avg) is dequeued, that second task (with
small burst_sleep_avg) would need to entirely scribble the other task's
cache lines within the time given by sysctl_sched_migration_cost, which
I suspect is typically not very large. So I doubt that the second task
can entirely kick out the first task cache lines within that time frame,
and therefore that second task should not move the cache_hot_timeout
value backwards.
But perhaps I'm missing something ?
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
next prev parent reply other threads:[~2023-09-12 15:17 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 2:49 [RFC PATCH 0/2] Makes it easier for the wakee to choose previous CPU Chen Yu
2023-09-11 2:49 ` [RFC PATCH 1/2] sched/fair: Record the average sleep time of a task Chen Yu
2023-09-11 2:50 ` [RFC PATCH 2/2] sched/fair: skip the cache hot CPU in select_idle_cpu() Chen Yu
2023-09-11 7:26 ` Aaron Lu
2023-09-11 8:40 ` Chen Yu
2023-09-13 6:22 ` Gautham R. Shenoy
2023-09-13 7:25 ` Chen Yu
2023-09-14 7:06 ` Gautham R. Shenoy
2023-09-14 12:09 ` Chen Yu
2023-09-15 15:18 ` Gautham R. Shenoy
2023-09-19 9:01 ` Chen Yu
2023-09-11 8:29 ` K Prateek Nayak
2023-09-11 10:19 ` Chen Yu
2023-09-12 3:05 ` K Prateek Nayak
2023-09-12 12:32 ` Chen Yu
2023-09-12 14:26 ` K Prateek Nayak
2023-09-13 2:57 ` Chen Yu
2023-09-14 4:13 ` K Prateek Nayak
2023-09-14 11:01 ` Chen Yu
2023-09-15 3:21 ` K Prateek Nayak
2023-09-12 9:39 ` Mike Galbraith
2023-09-12 14:51 ` Chen Yu
2023-09-12 6:32 ` Mike Galbraith
2023-09-11 15:26 ` Mathieu Desnoyers
2023-09-11 15:43 ` Mathieu Desnoyers
2023-09-12 11:53 ` Chen Yu
2023-09-12 14:06 ` Mathieu Desnoyers
2023-09-12 14:14 ` Chen Yu
2023-09-12 15:18 ` Mathieu Desnoyers [this message]
2023-09-13 3:02 ` Chen Yu
2023-09-20 12:34 ` Chen Yu
2023-09-14 5:30 ` K Prateek Nayak
2023-09-14 10:43 ` Chen Yu
2023-09-15 3:37 ` K Prateek Nayak
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=2a47ae82-b8cd-95db-9f48-82b3df0730f3@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=aaron.lu@intel.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.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=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