lkml.org 
[lkml]   [2020]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] cpu-topology: warn if NUMA configurations conflicts with lower layer
From
Date
On 03/01/2020 10:57, Valentin Schneider wrote:
> I'm juggling with other things atm, but let me have a think and see if we
> couldn't detect that in the scheduler itself.
>

Something like this ought to catch your case; might need to compare group
spans rather than pure group pointers.

---
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 6ec1e595b1d4..c4151e11afcd 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1120,6 +1120,13 @@ build_sched_groups(struct sched_domain *sd, int cpu)

sg = get_group(i, sdd);

+ /* sg's are inited as self-looping. If 'last' is not self
+ * looping, we set it in a previous visit. No further visit
+ * should change the link order, if we do then the topology
+ * description is terminally broken.
+ */
+ BUG_ON(last && last->next != last && last->next != sg);
+
cpumask_or(covered, covered, sched_group_span(sg));

if (!first)
\
 
 \ /
  Last update: 2020-01-03 13:15    [W:0.396 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site