]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/sched/sched.h
sched/topology: Reference the Energy Model of CPUs when available
[linux.git] / kernel / sched / sched.h
index 2eafa228aebf150d24a188a89f9dcbae79925a4a..808a565187b1de47dff2357f5478de09c08796db 100644 (file)
@@ -45,6 +45,7 @@
 #include <linux/ctype.h>
 #include <linux/debugfs.h>
 #include <linux/delayacct.h>
+#include <linux/energy_model.h>
 #include <linux/init_task.h>
 #include <linux/kprobes.h>
 #include <linux/kthread.h>
@@ -709,6 +710,12 @@ static inline bool sched_asym_prefer(int a, int b)
        return arch_asym_cpu_priority(a) > arch_asym_cpu_priority(b);
 }
 
+struct perf_domain {
+       struct em_perf_domain *em_pd;
+       struct perf_domain *next;
+       struct rcu_head rcu;
+};
+
 /*
  * We add the notion of a root-domain which will be used to define per-domain
  * variables. Each exclusive cpuset essentially defines an island domain by
@@ -761,6 +768,12 @@ struct root_domain {
        struct cpupri           cpupri;
 
        unsigned long           max_cpu_capacity;
+
+       /*
+        * NULL-terminated list of performance domains intersecting with the
+        * CPUs of the rd. Protected by RCU.
+        */
+       struct perf_domain      *pd;
 };
 
 extern struct root_domain def_root_domain;
@@ -2276,3 +2289,11 @@ unsigned long scale_irq_capacity(unsigned long util, unsigned long irq, unsigned
        return util;
 }
 #endif
+
+#ifdef CONFIG_SMP
+#ifdef CONFIG_ENERGY_MODEL
+#define perf_domain_span(pd) (to_cpumask(((pd)->em_pd->cpus)))
+#else
+#define perf_domain_span(pd) NULL
+#endif
+#endif