From: Peter Zijlstra <peterz@infradead.org>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org,
Suresh Siddha <suresh.b.siddha@intel.com>,
Venkatesh Pallipadi <venki@google.com>,
Srivatsa Vaddagiri <vatsa@in.ibm.com>,
Paul Turner <pjt@google.com>, Mike Galbraith <efault@gmx.de>,
Andreas Herrmann <andreas.herrmann3@amd.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: Re: "Cache" sched domains
Date: Thu, 16 Jun 2011 14:27:22 +0200 [thread overview]
Message-ID: <1308227242.13240.56.camel@twins> (raw)
In-Reply-To: <20110616121147.GA4644@const.bordeaux.inria.fr>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 4910 bytes --]
On Thu, 2011-06-16 at 14:11 +0200, Samuel Thibault wrote:
> Hello,
>
> We have an x86 machine whose sockets look like this in hwloc:
>
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> âSocket P#1 â
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> ââL3 (16MB) ââ
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> ââL2 (3072KB) ââL2 (3072KB) ââL2 (3072KB) ââ
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> ââL1 (32KB)ââL1 (32KB)ââL1 (32KB)ââL1 (32KB)ââL1 (32KB)ââL1 (32KB)ââ
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> ââCore P#0 ââCore P#1 ââCore P#2 ââCore P#3 ââCore P#4 ââCore P#5 ââ
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> âââPU P#0 ââââPU P#4 ââââPU P#8 ââââPU P#12ââââPU P#16ââââPU P#20âââ
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
> ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Pretty, bonus points for effort there.
> However, Linux does not build sched domains for the pairs of cores
> which share an L2 cache. On s390, IBM added sched domains for books,
> that is, sets of cores which share an L2 cache. The support should
> probably be added in a generic way for all archs thanks to generic cache
> information.
Yeah, sched domain generation is currently somewhat crappy.
I think you'll find you'll get that L2 domain when you enable mc/smt
power savings on !magny-cours due to this particular horror in
arch/x86/kernel/smpboot.c (possibly loosing another level due to other
crap and changing scheduler behaviour in ways you might not fancy):
const struct cpumask *cpu_coregroup_mask(int cpu)
{
struct cpuinfo_x86 *c = &cpu_data(cpu);
/*
* For perf, we return last level cache shared map.
* And for power savings, we return cpu_core_map
*/
if ((sched_mc_power_savings || sched_smt_power_savings) &&
!(cpu_has(c, X86_FEATURE_AMD_DCM)))
return cpu_core_mask(cpu);
else
return cpu_llc_shared_mask(cpu);
}
I recently started reworking all that sched_domain crud and we're almost
at the point where we can remove all legacy 'level' crap. That is,
nothing in the scheduler should (and does, last time I checked) depend
on sd->level anymore.
So the current goal is to change sched_domain_topology to not be such a
silly hard coded list of domains, but build that thing dynamically based
on the system topology and set all the SD_flags correctly.
If that is something you're willing to work on, that'd be totally
awesome.
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2011-06-16 12:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-16 12:11 "Cache" sched domains Samuel Thibault
2011-06-16 12:27 ` Peter Zijlstra [this message]
2011-06-16 13:20 ` Samuel Thibault
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=1308227242.13240.56.camel@twins \
--to=peterz@infradead.org \
--cc=andreas.herrmann3@amd.com \
--cc=efault@gmx.de \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=pjt@google.com \
--cc=samuel.thibault@ens-lyon.org \
--cc=suresh.b.siddha@intel.com \
--cc=vatsa@in.ibm.com \
--cc=venki@google.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