From: Ingo Molnar Date: Tue, 6 Jan 2009 08:33:57 +0000 (+0100) Subject: Merge branches 'sched/clock', 'sched/cleanups' and 'linus' into sched/urgent X-Git-Tag: v2.6.29-rc1~224^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d9be28ea9110c596a05bd2d56afa94251bd19818;p=linux-2.6-omap-h63xx.git Merge branches 'sched/clock', 'sched/cleanups' and 'linus' into sched/urgent --- d9be28ea9110c596a05bd2d56afa94251bd19818 diff --cc include/linux/sched.h index 91207df702e,8395e715809,01d9fd268eb,38a3f4b1539..c8a90bee263 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@@@@ -757,48 -758,16 -758,16 -757,48 +757,48 @@@@@ enum cpu_idle_type #define SD_SERIALIZE 1024 /* Only a single load balancing instance */ #define SD_WAKE_IDLE_FAR 2048 /* Gain latency sacrificing cache hit */ -- #define BALANCE_FOR_MC_POWER \ -- (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) ++ enum powersavings_balance_level { ++ POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */ ++ POWERSAVINGS_BALANCE_BASIC, /* Fill one thread/core/package ++ * first for long running threads ++ */ ++ POWERSAVINGS_BALANCE_WAKEUP, /* Also bias task wakeups to semi-idle ++ * cpu package for power savings ++ */ ++ MAX_POWERSAVINGS_BALANCE_LEVELS ++ }; + - #define BALANCE_FOR_PKG_POWER \ - ((sched_mc_power_savings || sched_smt_power_savings) ? \ - SD_POWERSAVINGS_BALANCE : 0) ++ extern int sched_mc_power_savings, sched_smt_power_savings; + - #define test_sd_parent(sd, flag) ((sd->parent && \ - (sd->parent->flags & flag)) ? 1 : 0) ++ static inline int sd_balance_for_mc_power(void) ++ { ++ if (sched_smt_power_savings) ++ return SD_POWERSAVINGS_BALANCE; + ++ return 0; ++ } ++ ++ static inline int sd_balance_for_package_power(void) ++ { ++ if (sched_mc_power_savings | sched_smt_power_savings) ++ return SD_POWERSAVINGS_BALANCE; + - #define BALANCE_FOR_PKG_POWER \ - ((sched_mc_power_savings || sched_smt_power_savings) ? \ - SD_POWERSAVINGS_BALANCE : 0) ++ return 0; ++ } ++ ++ /* ++ * Optimise SD flags for power savings: ++ * SD_BALANCE_NEWIDLE helps agressive task consolidation and power savings. ++ * Keep default SD flags if sched_{smt,mc}_power_saving=0 ++ */ + - #define test_sd_parent(sd, flag) ((sd->parent && \ - (sd->parent->flags & flag)) ? 1 : 0) ++ static inline int sd_power_saving_flags(void) ++ { ++ if (sched_mc_power_savings | sched_smt_power_savings) ++ return SD_BALANCE_NEWIDLE; + ++ return 0; ++ } struct sched_group { struct sched_group *next; /* Must be a circular list */ @@@@@ -900,27 -864,11 -864,11 -900,28 +900,27 @@@@@ struct sched_domain #ifdef CONFIG_SCHED_DEBUG char *name; #endif ++ ++ /* span of all CPUs in this domain */ ++ unsigned long span[]; }; -- extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, ++ static inline struct cpumask *sched_domain_span(struct sched_domain *sd) ++ { ++ return to_cpumask(sd->span); ++ } ++ ++ extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new, struct sched_domain_attr *dattr_new); ---extern int arch_reinit_sched_domains(void); ++ ++ /* Test a flag in parent sched domain */ ++ static inline int test_sd_parent(struct sched_domain *sd, int flag) ++ { ++ if (sd->parent && (sd->parent->flags & flag)) ++ return 1; ++ ++ return 0; ++ } #else /* CONFIG_SMP */