From: Peter Zijlstra <peterz@infradead.org>
To: "Chen, Yu C" <yu.c.chen@intel.com>
Cc: juri.lelli@redhat.com, vincent.guittot@linaro.org,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com,
tglx@linutronix.de, len.brown@intel.com, gautham.shenoy@amd.com,
mingo@kernel.org, kprateek.nayak@amd.com,
yu.chen.surf@foxmail.com
Subject: Re: [RFC][PATCH] sched: Cache aware load-balancing
Date: Tue, 25 Mar 2025 19:44:29 +0100 [thread overview]
Message-ID: <20250325184429.GA31413@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <4cd8ba54-8b9e-4563-8fbc-1d6cd6699e81@intel.com>
On Tue, Mar 25, 2025 at 11:19:52PM +0800, Chen, Yu C wrote:
>
> Hi Peter,
>
> Thanks for sending this out,
>
> On 3/25/2025 8:09 PM, Peter Zijlstra wrote:
> > Hi all,
> >
> > One of the many things on the eternal todo list has been finishing the
> > below hackery.
> >
> > It is an attempt at modelling cache affinity -- and while the patch
> > really only targets LLC, it could very well be extended to also apply to
> > clusters (L2). Specifically any case of multiple cache domains inside a
> > node.
> >
> > Anyway, I wrote this about a year ago, and I mentioned this at the
> > recent OSPM conf where Gautham and Prateek expressed interest in playing
> > with this code.
> >
> > So here goes, very rough and largely unproven code ahead :-)
> >
> > It applies to current tip/master, but I know it will fail the __percpu
> > validation that sits in -next, although that shouldn't be terribly hard
> > to fix up.
> >
> > As is, it only computes a CPU inside the LLC that has the highest recent
> > runtime, this CPU is then used in the wake-up path to steer towards this
> > LLC and in task_hot() to limit migrations away from it.
> >
> > More elaborate things could be done, notably there is an XXX in there
> > somewhere about finding the best LLC inside a NODE (interaction with
> > NUMA_BALANCING).
> >
>
> Besides the control provided by CONFIG_SCHED_CACHE, could we also introduce
> sched_feat(SCHED_CACHE) to manage this feature, facilitating dynamic
> adjustments? Similarly we can also introduce other sched_feats for load
> balancing and NUMA balancing for fine-grain control.
We can do all sorts, but the very first thing is determining if this is
worth it at all. Because if we can't make this work at all, all those
things are a waste of time.
This patch is not meant to be merged, it is meant for testing and
development. We need to first make it actually improve workloads. If it
then turns out it regresses workloads (likely, things always do), then
we can look at how to best do that.
next prev parent reply other threads:[~2025-03-25 18:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-25 12:09 [RFC][PATCH] sched: Cache aware load-balancing Peter Zijlstra
2025-03-25 15:19 ` Chen, Yu C
2025-03-25 18:44 ` Peter Zijlstra [this message]
2025-03-26 6:18 ` K Prateek Nayak
2025-03-26 9:15 ` Chen, Yu C
2025-03-26 9:42 ` Peter Zijlstra
2025-03-27 8:10 ` Chen, Yu C
2025-03-26 9:38 ` Peter Zijlstra
2025-03-26 10:25 ` Peter Zijlstra
2025-03-26 10:42 ` Peter Zijlstra
2025-03-26 10:46 ` Peter Zijlstra
[not found] ` <20250327112059.3661-1-hdanton@sina.com>
2025-03-31 6:25 ` Chen, Yu C
2025-03-27 2:48 ` Chen, Yu C
2025-03-27 2:43 ` Madadi Vineeth Reddy
2025-03-27 11:14 ` Chen, Yu C
2025-03-31 20:17 ` Madadi Vineeth Reddy
2025-03-28 13:57 ` Abel Wu
2025-03-29 15:06 ` Chen, Yu C
2025-03-30 8:46 ` Abel Wu
2025-03-31 5:25 ` Chen, Yu C
2025-03-31 8:04 ` Abel Wu
2025-03-31 21:06 ` Tim Chen
2025-04-02 1:52 ` Libo Chen
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=20250325184429.GA31413@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--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=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=yu.c.chen@intel.com \
--cc=yu.chen.surf@foxmail.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