sched: Rename DIE domain
Peter Zijlstra
maintainerRFC PATCH 1/1 sched: Rename DIE domain
Hi
Thomas just tripped over the x86 topology setup creating a 'DIE' domain for the package mask :-)
Since these names are SCHED_DEBUG only, rename them.
I don't think anybody *should* be relying on this, but who knows.
--- arch/powerpc/kernel/smp.c | 2 +- arch/s390/kernel/topology.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- kernel/sched/topology.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/kernel/smp.c +1 -1
@@ -1050,7 +1050,7 @@ static struct sched_domain_topology_level powerpc_topology[] = {#endif { shared_cache_mask, powerpc_shared_cache_flags, SD_INIT_NAME(CACHE) }, { cpu_mc_mask, SD_INIT_NAME(MC) }, - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };
arch/s390/kernel/topology.c +1 -1
@@ -522,7 +522,7 @@ static struct sched_domain_topology_level s390_topology[] = { { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, { cpu_book_mask, SD_INIT_NAME(BOOK) }, { cpu_drawer_mask, SD_INIT_NAME(DRAWER) }, - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };
arch/x86/kernel/smpboot.c +1 -1
@@ -653,7 +653,7 @@ static void __init build_sched_topology(void)*/ if (!x86_has_numa_in_package) { x86_topology[i++] = (struct sched_domain_topology_level ){ - cpu_cpu_mask,SD_INIT_NAME (DIE ) + cpu_cpu_mask,SD_INIT_NAME (PKG ) }; }
kernel/sched/topology.c +1 -1
@@ -1670,7 +1670,7 @@ static struct sched_domain_topology_level default_topology[] = { #ifdef CONFIG_SCHED_MC { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, #endif - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };
Quoted 8 lines · Peter Zijlstra
Hi
Thomas just tripped over the x86 topology setup creating a 'DIE' domain for the package mask :-)
Since these names are
SCHED_DEBUGonly, rename them.
I don't think anybody *should* be relying on this, but who knows.
FWIW I don't care much about the actual name.
There are some stray references to DIE in comments - see below. Bit funny to see:
- * - Package (DIE)
+ * - Package (PKG)
With that:
---
kernel/sched/fair.c +1 -1
@@ -9439,7 +9439,7 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu)* can only do it if @group is an SMT group and has exactly on busy CPU. Larger * imbalances in the number of CPUS are dealt with in find_busiest_group(). * -* If we are balancing load within an SMT core, or at DIE domain level, always +* If we are balancing load within an SMT core, or at PKG domain level, always * proceed. * * Return: true if @env::dst_cpu can do with asym_packing load balance. False
kernel/sched/topology.c +3 -3
@@ -1118,7 +1118,7 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu)* * - Simultaneous multithreading (SMT) * - Multi-Core Cache (MC) -* - Package (DIE) +* - Package (PKG) * * Where the last one more or less denotes everything up to a NUMA node. *
@@ -1140,13 +1140,13 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu)* * CPU 0 1 2 3 4 5 6 7 * -* DIE [ ] +* PKG [ ] * MC [ ] [ ] * SMT [ ] [ ] [ ] [ ] * * - or - * -* DIE 0-7 0-7 0-7 0-7 0-7 0-7 0-7 0-7 +* PKG 0-7 0-7 0-7 0-7 0-7 0-7 0-7 0-7 * MC 0-3 0-3 0-3 0-3 4-7 4-7 4-7 4-7 * SMT 0-1 0-1 2-3 2-3 4-5 4-5 6-7 6-7 *
Peter Zijlstra
maintainerQuoted 11 lines · Valentin Schneider
Quoted 8 lines · Peter Zijlstra
Hi
Thomas just tripped over the x86 topology setup creating a 'DIE' domain for the package mask :-)
Since these names are
SCHED_DEBUGonly, rename them.
I don't think anybody *should* be relying on this, but who knows.FWIW I don't care much about the actual name.
Confusion is due to x86 growing an actual die topology and this not being it.
Other than that, I can't be bothered too much about the silly name either.
Quoted 7 lines
There are some stray references to DIE in comments - see below. Bit funny to see:
- * - Package (DIE)
+ * - Package (PKG)With that:
Durr, I did a git-grep SD_INIT_NAME().. Thanks!
Quoted 12 lines · Valentin Schneider
Quoted 8 lines · Peter Zijlstra
Hi
Thomas just tripped over the x86 topology setup creating a 'DIE' domain for the package mask :-)
Since these names are
SCHED_DEBUGonly, rename them.
I don't think anybody *should* be relying on this, but who knows.FWIW I don't care much about the actual name.
Quoted 8 lines
There are some stray references to DIE in comments - see below. Bit funny to see:
- * - Package (DIE)
+ * - Package (PKG)With that:
No objection either, PKG is less ambiguous than DIE
Signature · 2 lines
Mel Gorman SUSE Labs
Quoted 54 lines · Valentin Schneider
Quoted 8 lines · Peter Zijlstra
Hi
Thomas just tripped over the x86 topology setup creating a 'DIE' domain for the package mask :-)
Since these names are
SCHED_DEBUGonly, rename them.
I don't think anybody *should* be relying on this, but who knows.FWIW I don't care much about the actual name.
There are some stray references to DIE in comments - see below. Bit funny to see:
- * - Package (DIE)
+ * - Package (PKG)With that:
---
kernel/sched/fair.c +1
-1@@ -9439,7 +9439,7 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu)* can only do it if @group is an SMT group and has exactly on busy CPU. Larger * imbalances in the number of CPUS are dealt with in find_busiest_group(). * -* If we are balancing load within an SMT core, or at DIE domain level, always +* If we are balancing load within an SMT core, or at PKG domain level, always * proceed. * * Return: true if @env::dst_cpu can do with asym_packing load balance. False kernel/sched/topology.c +2
-2@@ -1118,7 +1118,7 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu)* * - Simultaneous multithreading (SMT) * - Multi-Core Cache (MC) -* - Package (DIE) +* - Package (PKG) * * Where the last one more or less denotes everything up to a NUMA node. * @@ -1140,13 +1140,13 @@ build_overlap_sched_groups(struct sched_domain *sd, int cpu)* * CPU 0 1 2 3 4 5 6 7 * -* DIE [ ] +* PKG [ ]
kernel/sched/topology.c build_overlap_sched_groups(struct sched_domain *sd, int cpu) · line 1152
Quoted 10 lines
kernel/sched/topology.c +1
-1* MC [ ] [ ] * SMT [ ] [ ] [ ] [ ] * * - or - * -* DIE 0-7 0-7 0-7 0-7 0-7 0-7 0-7 0-7 +* PKG 0-7 0-7 0-7 0-7 0-7 0-7 0-7 0-7 * MC 0-3 0-3 0-3 0-3 4-7 4-7 4-7 4-7 * SMT 0-1 0-1 2-3 2-3 4-5 4-5 6-7 6-7 *
A couple of comments missing the change still? Not sure if it taken care already.
--- arch/powerpc/kernel/smp.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/smp.c +1 -1
@@ -1588,7 +1588,7 @@ static void add_cpu_to_masks(int cpu)/* Skip all CPUs already part of current CPU core mask */ cpumask_andnot (mask, cpu_online_mask,cpu_core_mask (cpu)); -/* If chip_id is -1; limit the cpu_core_mask to within DIE*/ +/* If chip_id is -1; limit the cpu_core_mask to within PKG*/ if (chip_id ==-1 )cpumask_and (mask, mask,cpu_cpu_mask (cpu));
arch/x86/kernel/smpboot.c +1 -1
@@ -647,7 +647,7 @@ static void __init build_sched_topology(void) };#endif /* -* When there is NUMA topology inside the package skip the DIE domain +* When there is NUMA topology inside the package skip the PKG domain * since the NUMA domains will auto-magically create the right spanning * domains based on the SLIT. */
Quoted 8 lines · Peter Zijlstra
Hi
Thomas just tripped over the x86 topology setup creating a 'DIE' domain for the package mask :-)
Since these names are
SCHED_DEBUGonly, rename them.
I don't think anybody *should* be relying on this, but who knows.
Quoted 7 lines
Signed-off-by Peter Zijlstra (Intel) <[email protected]>--- arch/powerpc/kernel/smp.c | 2 +- arch/s390/kernel/topology.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- kernel/sched/topology.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
For s390:
Quoted 9 lines · Peter Zijlstra
Hi
Thomas just tripped over the x86 topology setup creating a 'DIE' domain for the package mask :-)
Since these names are
SCHED_DEBUGonly, rename them.
I don't think anybody *should* be relying on this, but who knows.Signed-off-by Peter Zijlstra (Intel) <[email protected]>
This naming makes sense.
--
Thanks and Regards
gautham.
Vincent Guittot
maintainerQuoted 5 lines · Peter Zijlstra
Hi
Thomas just tripped over the x86 topology setup creating a 'DIE' domain for the package mask :-)
May be a link to the change that triggers this patch could be useful
Quoted 3 lines
Since these names are
SCHED_DEBUGonly, rename them.
I don't think anybody *should* be relying on this, but who knows.
Apart the remaining reference to DIE already mentioned by others, looks good to me
Quoted 62 lines
Signed-off-by Peter Zijlstra (Intel) <[email protected]>--- arch/powerpc/kernel/smp.c | 2 +- arch/s390/kernel/topology.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- kernel/sched/topology.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)arch/powerpc/kernel/smp.c +1
-1@@ -1050,7 +1050,7 @@ static struct sched_domain_topology_level powerpc_topology[] = {#endif { shared_cache_mask, powerpc_shared_cache_flags, SD_INIT_NAME(CACHE) }, { cpu_mc_mask, SD_INIT_NAME(MC) }, - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };arch/s390/kernel/topology.c +1
-1@@ -522,7 +522,7 @@ static struct sched_domain_topology_level s390_topology[] = { { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, { cpu_book_mask, SD_INIT_NAME(BOOK) }, { cpu_drawer_mask, SD_INIT_NAME(DRAWER) }, - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };arch/x86/kernel/smpboot.c +1
-1@@ -653,7 +653,7 @@ static void __init build_sched_topology(void)*/ if (!x86_has_numa_in_package) { x86_topology[i++] = (struct sched_domain_topology_level ){ - cpu_cpu_mask,SD_INIT_NAME (DIE ) + cpu_cpu_mask,SD_INIT_NAME (PKG ) }; }kernel/sched/topology.c +1
-1@@ -1670,7 +1670,7 @@ static struct sched_domain_topology_level default_topology[] = { #ifdef CONFIG_SCHED_MC { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, #endif - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };
Peter Zijlstra
maintainerQuoted 8 lines · Vincent Guittot
Quoted 5 lines · Peter Zijlstra
Hi
Thomas just tripped over the x86 topology setup creating a 'DIE' domain for the package mask :-)
May be a link to the change that triggers this patch could be useful
Thomas should post soonish..
[tip: sched/core] sched/topology: Rename 'DIE' domain to 'PKG'
In reply to Peter ZijlstraThe following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: f577cd57bfaa889cf0718e30e92c08c7f78c9d85 Gitweb: https://git.kernel.org/tip/f577cd57bfaa889cf0718e30e92c08c7f78c9d85 Author: Peter Zijlstra <[email protected]> AuthorDate: Wed, 12 Jul 2023 16:10:56 +02:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Thu, 12 Oct 2023 09:38:16 +02:00
sched/topology: Rename 'DIE' domain to 'PKG'
While reworking the x86 topology code Thomas tripped over creating a 'DIE' domain for the package mask. :-)
Since these names are CONFIG_SCHED_DEBUG=y only, rename them to make the name less ambiguous.
[ Shrikanth Hegde: rename on s390 as well. ]
[ Valentin Schneider: also rename it in the comments. ] [ mingo: port to recent kernels & find all remaining occurances. ]
--- arch/powerpc/kernel/smp.c | 4 ++-- arch/s390/kernel/topology.c | 2 +- arch/x86/kernel/smpboot.c | 4 ++-- kernel/sched/fair.c | 2 +- kernel/sched/topology.c | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-)
arch/powerpc/kernel/smp.c +2 -2
@@ -1051,7 +1051,7 @@ static struct sched_domain_topology_level powerpc_topology[] = {#endif { shared_cache_mask, powerpc_shared_cache_flags, SD_INIT_NAME(CACHE) }, { cpu_mc_mask, SD_INIT_NAME(MC) }, - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };
@@ -1595,7 +1595,7 @@ static void add_cpu_to_masks(int cpu)/* Skip all CPUs already part of current CPU core mask */ cpumask_andnot (mask, cpu_online_mask,cpu_core_mask (cpu)); -/* If chip_id is -1; limit the cpu_core_mask to within DIE*/ +/* If chip_id is -1; limit the cpu_core_mask to within PKG */ if (chip_id ==-1 )cpumask_and (mask, mask,cpu_cpu_mask (cpu));
arch/s390/kernel/topology.c +1 -1
@@ -522,7 +522,7 @@ static struct sched_domain_topology_level s390_topology[] = { { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, { cpu_book_mask, SD_INIT_NAME(BOOK) }, { cpu_drawer_mask, SD_INIT_NAME(DRAWER) }, - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };
arch/x86/kernel/smpboot.c +2 -2
@@ -641,13 +641,13 @@ static void __init build_sched_topology(void) };#endif /* -* When there is NUMA topology inside the package skip the DIE domain +* When there is NUMA topology inside the package skip the PKG domain * since the NUMA domains will auto-magically create the right spanning * domains based on the SLIT. */ if (!x86_has_numa_in_package) { x86_topology[i++] = (struct sched_domain_topology_level ){ - cpu_cpu_mask, x86_die_flags,SD_INIT_NAME (DIE ) + cpu_cpu_mask, x86_die_flags,SD_INIT_NAME (PKG ) }; }
kernel/sched/fair.c +1 -1
@@ -9555,7 +9555,7 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu)* can only do it if @group is an SMT group and has exactly on busy CPU. Larger * imbalances in the number of CPUS are dealt with in find_busiest_group(). * -* If we are balancing load within an SMT core, or at DIE domain level, always +* If we are balancing load within an SMT core, or at PKG domain level, always * proceed. * * Return: true if @env::dst_cpu can do with asym_packing load balance. False
kernel/sched/topology.c +4 -4
@@ -1119,7 +1119,7 @@ fail:* * - Simultaneous multithreading (SMT) * - Multi-Core Cache (MC) -* - Package (DIE) +* - Package (PKG) * * Where the last one more or less denotes everything up to a NUMA node. *
@@ -1141,13 +1141,13 @@ fail:* * CPU 0 1 2 3 4 5 6 7 * -* DIE [ ] +* PKG [ ] * MC [ ] [ ] * SMT [ ] [ ] [ ] [ ] * * - or - * -* DIE 0-7 0-7 0-7 0-7 0-7 0-7 0-7 0-7 +* PKG 0-7 0-7 0-7 0-7 0-7 0-7 0-7 0-7 * MC 0-3 0-3 0-3 0-3 4-7 4-7 4-7 4-7 * SMT 0-1 0-1 2-3 2-3 4-5 4-5 6-7 6-7 *
@@ -1681,7 +1681,7 @@ static struct sched_domain_topology_level default_topology[] = { #ifdef CONFIG_SCHED_MC { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) }, #endif - { cpu_cpu_mask, SD_INIT_NAME(DIE) }, + { cpu_cpu_mask, SD_INIT_NAME(PKG) }, { NULL, }, };