From: Tim Chen <tim.c.chen@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Tim Chen <tim.c.chen@linux.intel.com>,
Arjan Van De Ven <arjan.van.de.ven@intel.com>,
Ricardo Neri <ricardo.neri@intel.com>,
Len Brown <len.brown@intel.com>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
Chen Yu <yu.c.chen@intel.com>,
Song Bao Hua <song.bao.hua@hisilicon.com>,
yangyicong <yangyicong@huawei.com>,
Michael Larabel <Michael@MichaelLarabel.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] scheduler: Add SD_CLUSTER topology flag to cluster sched domain
Date: Fri, 3 Dec 2021 12:32:39 -0800 [thread overview]
Message-ID: <efda38b9a2c629aa7270aeba0e65ae420383bdb7.1638563225.git.tim.c.chen@linux.intel.com> (raw)
In-Reply-To: <cover.1638563225.git.tim.c.chen@linux.intel.com>
Add SD_CLUSTER to flag cluster sched domain topology.
Scheduler needs to know if a topology level is at cluster level. It can
then decide if cluster sched domain should be built based on boot or run
time configuration specified in next patch.
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
---
include/linux/sched/sd_flags.h | 7 +++++++
include/linux/sched/topology.h | 2 +-
kernel/sched/topology.c | 3 +++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/linux/sched/sd_flags.h b/include/linux/sched/sd_flags.h
index 57bde66d95f7..2321f1b4cee6 100644
--- a/include/linux/sched/sd_flags.h
+++ b/include/linux/sched/sd_flags.h
@@ -164,3 +164,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 between groups.
+ */
+SD_FLAG(SD_CLUSTER, SDF_NEEDS_GROUPS)
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h
index a6ad1e02e57a..d71e75f03619 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 ee6b14ad3324..0c11531a64a0 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1504,6 +1504,8 @@ static unsigned long __read_mostly *sched_numa_onlined_nodes;
* function:
*
* SD_SHARE_CPUCAPACITY - describes SMT topologies
+ * SD_CLUSTER - describes multiple CPU clusters in a
+ * last level cache
* SD_SHARE_PKG_RESOURCES - describes shared caches
* SD_NUMA - describes NUMA topologies
*
@@ -1514,6 +1516,7 @@ static unsigned long __read_mostly *sched_numa_onlined_nodes;
*/
#define TOPOLOGY_SD_FLAGS \
(SD_SHARE_CPUCAPACITY | \
+ SD_CLUSTER | \
SD_SHARE_PKG_RESOURCES | \
SD_NUMA | \
SD_ASYM_PACKING)
--
2.20.1
next prev parent reply other threads:[~2021-12-03 21:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 20:32 [PATCH 0/5] Make Cluster Scheduling Configurable Tim Chen
2021-12-03 20:32 ` [PATCH 1/5] scheduler: Create SDTL_SKIP flag to skip topology level Tim Chen
2021-12-03 20:32 ` Tim Chen [this message]
2021-12-03 20:32 ` [PATCH 3/5] scheduler: Add runtime knob sysctl_sched_cluster Tim Chen
2021-12-03 20:32 ` [PATCH 4/5] scheduler: Add boot time enabling/disabling of cluster scheduling Tim Chen
2021-12-04 6:47 ` Yicong Yang
2021-12-03 20:32 ` [PATCH 5/5] scheduler: Default cluster scheduling to off on x86 hybrid CPU Tim Chen
2021-12-04 9:14 ` [PATCH 0/5] Make Cluster Scheduling Configurable Peter Zijlstra
2021-12-06 18:42 ` Tim Chen
2021-12-06 22:05 ` Ricardo Neri
2021-12-07 15:49 ` Tim Chen
2021-12-08 21:27 ` [tip: sched/urgent] sched,x86: Don't use cluster topology for x86 hybrid CPUs tip-bot2 for Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=efda38b9a2c629aa7270aeba0e65ae420383bdb7.1638563225.git.tim.c.chen@linux.intel.com \
--to=tim.c.chen@linux.intel.com \
--cc=Michael@MichaelLarabel.com \
--cc=arjan.van.de.ven@intel.com \
--cc=artem.bityutskiy@linux.intel.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=ricardo.neri@intel.com \
--cc=song.bao.hua@hisilicon.com \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=yangyicong@huawei.com \
--cc=yu.c.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox