diff options
Diffstat (limited to 'include/linux/sched/topology.h')
-rw-r--r-- | include/linux/sched/topology.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h index 5a92baa91e0c..b45ae1319c95 100644 --- a/include/linux/sched/topology.h +++ b/include/linux/sched/topology.h @@ -26,6 +26,7 @@ #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ #define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */ #define SD_NUMA 0x4000 /* cross-node balancing */ +#define SD_SHARE_CAP_STATES 0x8000 /* Domain members share capacity state */ /* * Increase resolution of cpu_capacity calculations @@ -66,12 +67,31 @@ struct sched_domain_attr { extern int sched_domain_level_max; +struct capacity_state { + unsigned long cap; /* compute capacity */ + unsigned long frequency;/* frequency */ + unsigned long power; /* power consumption at this compute capacity */ +}; + +struct idle_state { + unsigned long power; /* power consumption in this idle state */ +}; + +struct sched_group_energy { + unsigned int nr_idle_states; /* number of idle states */ + struct idle_state *idle_states; /* ptr to idle state array */ + unsigned int nr_cap_states; /* number of capacity states */ + struct capacity_state *cap_states; /* ptr to capacity state array */ +}; + struct sched_group; struct sched_domain_shared { atomic_t ref; atomic_t nr_busy_cpus; int has_idle_cores; + + bool overutilized; }; struct sched_domain { @@ -173,6 +193,9 @@ bool cpus_share_cache(int this_cpu, int that_cpu); typedef const struct cpumask *(*sched_domain_mask_f)(int cpu); typedef int (*sched_domain_flags_f)(void); +typedef +const struct sched_group_energy * const(*sched_domain_energy_f)(int cpu); +extern bool energy_aware(void); #define SDTL_OVERLAP 0x01 @@ -186,6 +209,7 @@ struct sd_data { struct sched_domain_topology_level { sched_domain_mask_f mask; sched_domain_flags_f sd_flags; + sched_domain_energy_f energy; int flags; int numa_level; struct sd_data data; |