sched: group CPU power setup cleanup
PATCH 1/1 sched: group CPU power setup cleanup
I will be away for few days. Will respond on 5th to any comments.
thanks,
suresh
--
Cleanup the sched group cpu_power setup code, by introducing child field and new domain flag in sched_domain.
Signed-off-by Suresh Siddha <[email protected]>
include/asm-i386/topology.h +1 -0
@@ -74,6 +74,7 @@ static inline int node_to_first_cpu(int#define SD_NODE_INIT (struct sched_domain) { \ .span = CPU_MASK_NONE, \ .parent = NULL, \ + .child = NULL, \ .groups = NULL, \ .min_interval = 8, \ .max_interval = 32, \
include/asm-ia64/topology.h +2 -0
@@ -59,6 +59,7 @@ void build_cpu_to_node_map(void);#define SD_CPU_INIT (struct sched_domain) { \ .span = CPU_MASK_NONE, \ .parent = NULL, \ + .child = NULL, \ .groups = NULL, \ .min_interval = 1, \ .max_interval = 4, \
@@ -84,6 +85,7 @@ void build_cpu_to_node_map(void);#define SD_NODE_INIT (struct sched_domain) { \ .span = CPU_MASK_NONE, \ .parent = NULL, \ + .child = NULL, \ .groups = NULL, \ .min_interval = 8, \ .max_interval = 8*(min(num_online_cpus(), 32)), \
include/asm-mips/mach-ip27/topology.h +1 -0
@@ -22,6 +22,7 @@ extern unsigned char __node_distances[MA#define SD_NODE_INIT (struct sched_domain) { \ .span = CPU_MASK_NONE, \ .parent = NULL, \ + .child = NULL, \ .groups = NULL, \ .min_interval = 8, \ .max_interval = 32, \
include/asm-powerpc/topology.h +1 -0
@@ -43,6 +43,7 @@ extern int pcibus_to_node(struct pci_bus#define SD_NODE_INIT (struct sched_domain) { \ .span = CPU_MASK_NONE, \ .parent = NULL, \ + .child = NULL, \ .groups = NULL, \ .min_interval = 8, \ .max_interval = 32, \
include/asm-x86_64/topology.h +1 -0
@@ -31,6 +31,7 @@ extern int __node_distance(int, int);#define SD_NODE_INIT (struct sched_domain) { \ .span = CPU_MASK_NONE, \ .parent = NULL, \ + .child = NULL, \ .groups = NULL, \ .min_interval = 8, \ .max_interval = 32, \
include/linux/sched.h +10 -2
@@ -576,9 +576,16 @@ enum idle_type#define SD_WAKE_BALANCE 64/* Perform balancing at task wakeup */ #define SD_SHARE_CPUPOWER 128/* Domain members share cpu power */ #define SD_POWERSAVINGS_BALANCE 256/* Balance for power savings */ +#define SD_SHARE_PKG_RESOURCES 512/* Domain members share cpu pkg resources */ -#define BALANCE_FOR_POWER ((sched_mc_power_savings || sched_smt_power_savings) \ - ? SD_POWERSAVINGS_BALANCE : 0) +#define BALANCE_FOR_MC_POWER (sched_smt_power_savings ? \ + SD_POWERSAVINGS_BALANCE : 0) + +#define BALANCE_FOR_PKG_POWER \ + ((sched_mc_power_savings || sched_smt_power_savings) ? \ + SD_POWERSAVINGS_BALANCE : 0) + +#define test_sd_flag (sd, flag) ((sd && sd->flags & flag) ? 1 : 0)struct sched_group {
@@ -595,6 +602,7 @@ struct sched_group {struct sched_domain {/* These fields must be setup */ struct sched_domain *parent;/* top domain must be null terminated */ +struct sched_domain *child;/* bottom domain must be null terminated */ struct sched_group *groups;/* the balancing groups of the domain */ cpumask_t span;/* span of all CPUs in this domain */ unsigned long min_interval;/* Minimum balance interval ms */
include/linux/topology.h +36 -10
81 lines not on this page · raw message
kernel/sched.c +78 -76
281 lines not on this page · raw message