linux/arch/powerpc
Gautham R. Shenoy 9538abee18 powerpc/smp: Add support detecting thread-groups sharing L2 cache
On POWER systems, groups of threads within a core sharing the L2-cache
can be indicated by the "ibm,thread-groups" property array with the
identifier "2".

This patch adds support for detecting this, and when present, populate
the populating the cpu_l2_cache_mask of every CPU to the core-siblings
which share L2 with the CPU as specified in the by the
"ibm,thread-groups" property array.

On a platform with the following "ibm,thread-group" configuration
		 00000001 00000002 00000004 00000000
		 00000002 00000004 00000006 00000001
		 00000003 00000005 00000007 00000002
		 00000002 00000004 00000000 00000002
		 00000004 00000006 00000001 00000003
		 00000005 00000007

Without this patch, the sched-domain hierarchy for CPUs 0,1 would be
	CPU0 attaching sched-domain(s):
	domain-0: span=0,2,4,6 level=SMT
	domain-1: span=0-7 level=CACHE
	domain-2: span=0-15,24-39,48-55 level=MC
	domain-3: span=0-55 level=DIE

	CPU1 attaching sched-domain(s):
	domain-0: span=1,3,5,7 level=SMT
	domain-1: span=0-7 level=CACHE
	domain-2: span=0-15,24-39,48-55 level=MC
	domain-3: span=0-55 level=DIE

The CACHE domain at 0-7 is incorrect since the ibm,thread-groups
sub-array
[00000002 00000002 00000004
 00000000 00000002 00000004 00000006
 00000001 00000003 00000005 00000007]
indicates that L2 (Property "2") is shared only between the threads of a single
group. There are "2" groups of threads where each group contains "4"
threads each. The groups being {0,2,4,6} and {1,3,5,7}.

With this patch, the sched-domain hierarchy for CPUs 0,1 would be
     	CPU0 attaching sched-domain(s):
	domain-0: span=0,2,4,6 level=SMT
	domain-1: span=0-15,24-39,48-55 level=MC
	domain-2: span=0-55 level=DIE

	CPU1 attaching sched-domain(s):
	domain-0: span=1,3,5,7 level=SMT
	domain-1: span=0-15,24-39,48-55 level=MC
	domain-2: span=0-55 level=DIE

The CACHE domain with span=0,2,4,6 for CPU 0 (span=1,3,5,7 for CPU 1
resp.) gets degenerated into the SMT domain. Furthermore, the
last-level-cache domain gets correctly set to the SMT sched-domain.

Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1607596739-32439-5-git-send-email-ego@linux.vnet.ibm.com
2020-12-11 00:10:25 +11:00
..
boot powerpc/boot: Make use of REL16 relocs in powerpc/boot/util.S 2020-12-04 01:00:44 +11:00
configs powerpc: add security.config, enforcing lockdown=integrity 2020-12-04 01:01:34 +11:00
crypto crypto: powerpc/crc-vpmsum_test - Fix sparse endianness warning 2020-09-04 17:57:15 +10:00
include powerpc/smp: Add support detecting thread-groups sharing L2 cache 2020-12-11 00:10:25 +11:00
kernel powerpc/smp: Add support detecting thread-groups sharing L2 cache 2020-12-11 00:10:25 +11:00
kexec arch, drivers: replace for_each_membock() with for_each_mem_range() 2020-10-13 18:38:35 -07:00
kvm powerpc/64s: Remove MSR[ISF] bit 2020-12-09 23:48:14 +11:00
lib powerpc/sstep: Add testcases for VSX vector paired load/store instructions 2020-12-11 00:09:10 +11:00
math-emu
mm powerpc/64s/iommu: Don't use atomic_ function on atomic64_t type 2020-12-09 23:48:14 +11:00
net bpf, powerpc: Fix misuse of fallthrough in bpf_jit_comp() 2020-09-29 16:39:11 +02:00
oprofile powerpc/oprofile: fix spelling mistake "contex" -> "context" 2020-08-25 01:31:33 +10:00
perf powerpc/perf: Exclude kernel samples while counting events in user space. 2020-12-10 23:04:35 +11:00
platforms powerpc/64: irq replay remove decrementer overflow check 2020-12-09 23:48:15 +11:00
purgatory powerpc/kexec_file: Enable early kernel OPAL calls 2020-07-29 23:47:55 +10:00
sysdev powerpc: sysdev: add missing iounmap() on error in mpic_msgr_probe() 2020-11-19 14:50:14 +11:00
tools powerpc/tools: Remove 90 line limit in checkpatch script 2020-09-08 22:57:11 +10:00
xmon powerpc/xmon: Change printk() to pr_cont() 2020-12-04 21:56:30 +11:00
Kbuild
Kconfig powerpc/8xx: Always pin kernel text TLB 2020-12-09 23:47:45 +11:00
Kconfig.debug powerpc: Remove Xilinx PPC405/PPC440 support 2020-05-28 23:24:34 +10:00
Makefile powerpc/vdso: Retrieve sigtramp offsets at buildtime 2020-12-04 01:01:17 +11:00
Makefile.postlink powerpc: unrel_branch_check.sh: use nm to find symbol value 2020-09-02 11:00:22 +10:00