Skip to contentSkip to conversation

cpusets: add basic variables

PATCH In review Michael Wang 1 participant 1 message Jul 17, 2012 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 cpusets: add basic variables

From: Michael Wang <[email protected]>

Add the variables we need for the implementation of dynamical domain flags.

---
 include/linux/sched.h |   22 ++++++++++++++++++++++
 kernel/cpuset.c       |    7 +++++++
 2 files changed, 29 insertions(+), 0 deletions(-)
include/linux/sched.h +22 -0
index ddc1225..9164309 100644
@@ -922,8 +922,30 @@ static inline unsigned int group_first_cpu(struct sched_group *group)
 	return cpumask_first(sched_group_cpus(group));
 }
 
+enum {
+#ifdef CONFIG_SCHED_SMT
+	SMT_DDF,
+#endif
+#ifdef CONFIG_SCHED_MC
+	MC_DDF,
+#endif
+#ifdef CONFIG_SCHED_BOOK
+	BOOK_DDF,
+#endif
+	CPU_DDF,
+	MAX_DDF,
+};
+
 struct sched_domain_attr {
 	int relax_domain_level;
+	/*
+	 * dynamical domain flag array cover all level, only useful if
+	 * enable_ddf is 1.
+	 * the static domain flags will be replaced by ddf on each domain
+	 * level dynamically in set_domain_attribute.
+	 */
+	u64 ddf[MAX_DDF];
+	int enable_ddf;
 };
 
 #define SD_ATTR_INIT	(struct sched_domain_attr) {	\
kernel/cpuset.c +7 -0
index 0cbc631..35fb585 100644
@@ -105,6 +105,13 @@ struct cpuset {
 	/* for custom sched domain */
 	int relax_domain_level;
 
+	/*
+	 * dynamical domain flag configuration for cpuset, see struct
+	 * sched_domain_attr for detail.
+	 */
+	u64 ddf[MAX_DDF];
+	int enable_ddf;
+
 	/* used for walking a cpuset hierarchy */
 	struct list_head stack_list;
 };
Signature · 1 line
1.7.4.1