Add SD_CLUSTER to prepare flagging cluster sched domain topology later. System needs to know if a topology level is a cluster level that needs special handling based. Cluster domain should be built based on runtime configuration. --- include/linux/sched/sd_flags.h | 7 +++++++ include/linux/sched/topology.h | 2 +- kernel/sched/topology.c | 1 + 3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/linux/sched/sd_flags.h b/include/linux/sched/sd_flags.h index 34b21e971d77..ca7744119582 100644 --- a/include/linux/sched/sd_flags.h +++ b/include/linux/sched/sd_flags.h @@ -154,3 +154,10 @@ SD_FLAG(SD_OVERLAP, SDF_SHARED_PARENT | SDF_NEEDS_GROUPS) * NEEDS_GROUPS: No point in preserving domain if it has a single group. */ SD_FLAG(SD_NUMA, SDF_SHARED_PARENT | SDF_NEEDS_GROUPS) + +/* + * Domain members in the same CPU cluster + * + * NEEDS_GROUPS: Cluster resroucres are shared shared between groups. + */ +SD_FLAG(SD_CLUSTER, SDF_NEEDS_GROUPS) diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 8ebabc0dffb3..5578aae00e82 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -45,7 +45,7 @@ static inline int cpu_smt_flags(void) #ifdef CONFIG_SCHED_CLUSTER static inline int cpu_cluster_flags(void) { - return SD_SHARE_PKG_RESOURCES; + return SD_CLUSTER | SD_SHARE_PKG_RESOURCES; } #endif
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 22bf80d658c4..b019129e515e 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1393,6 +1393,7 @@ int __read_mostly node_reclaim_distance = RECLAIM_DISTANCE; #define TOPOLOGY_SD_FLAGS \ (SD_SHARE_CPUCAPACITY | \ SD_SHARE_PKG_RESOURCES | \ + SD_CLUSTER | \ SD_NUMA | \ SD_ASYM_PACKING)