The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Chen Yu <yu.c.chen@intel.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>,
	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>,
	"Gautham R . Shenoy" <gautham.shenoy@amd.com>, <x86@kernel.org>
Subject: Re: [RFC PATCH v2 0/2] sched/fair migration reduction features
Date: Thu, 9 Nov 2023 22:58:00 +0800	[thread overview]
Message-ID: <ZUzzeEptTlgalJIc@chenyu5-mobl2.ccr.corp.intel.com> (raw)
In-Reply-To: <909fd5b2-a1c6-49cf-8efa-c71affb1a4fe@efficios.com>

On 2023-11-06 at 11:32:02 -0500, Mathieu Desnoyers wrote:
> On 2023-10-26 23:27, K Prateek Nayak wrote:
> [...]
> > --
> > It is a mixed bag of results, as expected. I would love to hear your
> > thoughts on the results. Meanwhile, I'll try to get some more data
> > from other benchmarks.
> 
> I suspect that workloads that exhibit a client-server (1:1) pairing pattern
> are hurt by the bias towards leaving tasks on their prev runqueue: they
> benefit from moving both client/server tasks as close as possible so they
> share either the same core or a common cache.

Yes, this should be true if the wakee's previous runqueue is not idle, at least
on Prateek's machine. Does it mean, the change in PATCH 2/2 that "chooses previous
CPU over target CPU when all CPUs are busy" might not be a universal win for the
1:1 workloads?

> 
> The hackbench workload is also client-server, but there are N-client and
> N-server threads, creating a N:N relationship which really does not work
> well when trying to pull tasks on sync wakeup: tasks then bounce all over
> the place.
> 
> It's tricky though. If we try to fix the "1:1" client-server pattern with a
> heuristic, we may miss scenarios which are close to 1:1 but don't exactly
> match.
> 
> I'm working on a rewrite of select_task_rq_fair, with the aim to tackle the
> more general task placement problem taking into account the following:
> 
> - We want to converge towards a task placement that moves tasks with
>   most waker/wakee interactions as close as possible in the cache
>   topology,
> - We can use the core util_est/capacity metrics to calculate whether we
>   have capacity left to enqueue a task in a core's runqueue.
> - The underlying assumption is that work conserving [1] is not a good
>   characteristic to aim for, because it does not take into account the
>   overhead associated with migrations, and thus lack of cache locality.

Agree, one pain point is how to figure out the requirement of a wakee.
Does the wakee want an idle CPU, or want cache locality? One heuristic
I'm thinking of to predict if a task is cache sensitive: check both the task's
average runtime, and its average sleep time. If the runtime is long, it usually
indicates that this task has large cache footprint, in terms of icache/dcache.
If the sleep time is short, it means that this task is likely to revisit its hot
cache soon.

thanks,
Chenyu

      reply	other threads:[~2023-11-09 15:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19 16:05 [RFC PATCH v2 0/2] sched/fair migration reduction features Mathieu Desnoyers
2023-10-19 16:05 ` [RFC PATCH v2 1/2] sched/fair: Introduce UTIL_FITS_CAPACITY feature (v2) Mathieu Desnoyers
2023-10-23 14:11   ` Dietmar Eggemann
2023-10-23 15:04     ` Mathieu Desnoyers
2023-10-24  6:10       ` Chen Yu
2023-10-24 14:49         ` Mathieu Desnoyers
2023-10-25  7:19           ` Chen Yu
2023-10-24 15:03         ` Dietmar Eggemann
2023-10-25  7:34           ` Chen Yu
2023-10-24 14:10       ` Dietmar Eggemann
2023-10-25  7:56   ` Peter Zijlstra
2023-10-25 14:04     ` Mathieu Desnoyers
2023-10-19 16:05 ` [RFC PATCH v2 2/2] sched/fair: Introduce SELECT_BIAS_PREV to reduce migrations Mathieu Desnoyers
2023-10-27  3:27 ` [RFC PATCH v2 0/2] sched/fair migration reduction features K Prateek Nayak
2023-11-06  5:52   ` Chen Yu
2023-11-06  7:06     ` K Prateek Nayak
2023-11-06 17:18       ` Mathieu Desnoyers
2023-11-07  3:02         ` K Prateek Nayak
2023-11-06 16:32   ` Mathieu Desnoyers
2023-11-09 14:58     ` Chen Yu [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=ZUzzeEptTlgalJIc@chenyu5-mobl2.ccr.corp.intel.com \
    --to=yu.c.chen@intel.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=mathieu.desnoyers@efficios.com \
    --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 \
    /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