If the system admin does not want to use cluster scheduling, we want to later allow cluster topology level to be skipped when building sched domains.
Create SDTL_SKIP bit on the sched_domain_topology_level flag so we can check if a topology level should be skipped when building sched domains. --- include/linux/sched/topology.h | 1 + kernel/sched/topology.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 2f9166f6dec8..8ebabc0dffb3 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -182,6 +182,7 @@ typedef const struct cpumask *(*sched_domain_mask_f)(int cpu); typedef int (*sched_domain_flags_f)(void);
#define SDTL_OVERLAP 0x01 +#define SDTL_SKIP 0x02
struct sd_data { struct sched_domain *__percpu *sd; diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index c7523dc7aab7..22bf80d658c4 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1526,8 +1526,16 @@ static struct sched_domain_topology_level default_topology[] = { static struct sched_domain_topology_level *sched_domain_topology = default_topology;
+static struct sched_domain_topology_level *next_tl(struct sched_domain_topology_level *tl) +{ + ++tl; + while (tl->mask && tl->flags & SDTL_SKIP) + ++tl; + return tl; +} + #define for_each_sd_topology(tl) \ - for (tl = sched_domain_topology; tl->mask; tl++) + for (tl = sched_domain_topology; tl->mask; tl = next_tl(tl))
void set_sched_topology(struct sched_domain_topology_level *tl) {