aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4240f6bfa812..1210fb0e45ff 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -763,15 +763,23 @@ enum cpu_idle_type {
763#define SD_SERIALIZE 1024 /* Only a single load balancing instance */ 763#define SD_SERIALIZE 1024 /* Only a single load balancing instance */
764#define SD_WAKE_IDLE_FAR 2048 /* Gain latency sacrificing cache hit */ 764#define SD_WAKE_IDLE_FAR 2048 /* Gain latency sacrificing cache hit */
765 765
766#define BALANCE_FOR_MC_POWER \ 766extern int sched_mc_power_savings, sched_smt_power_savings;
767 (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) 767
768static inline int sd_balance_for_mc_power(void)
769{
770 if (sched_smt_power_savings)
771 return SD_POWERSAVINGS_BALANCE;
768 772
769#define BALANCE_FOR_PKG_POWER \ 773 return 0;
770 ((sched_mc_power_savings || sched_smt_power_savings) ? \ 774}
771 SD_POWERSAVINGS_BALANCE : 0)
772 775
773#define test_sd_parent(sd, flag) ((sd->parent && \ 776static inline int sd_balance_for_package_power(void)
774 (sd->parent->flags & flag)) ? 1 : 0) 777{
778 if (sched_mc_power_savings | sched_smt_power_savings)
779 return SD_POWERSAVINGS_BALANCE;
780
781 return 0;
782}
775 783
776 784
777struct sched_group { 785struct sched_group {
@@ -1399,6 +1407,15 @@ struct task_struct {
1399#endif 1407#endif
1400}; 1408};
1401 1409
1410/* Test a flag in parent sched domain */
1411static inline int test_sd_parent(struct sched_domain *sd, int flag)
1412{
1413 if (sd->parent && (sd->parent->flags & flag))
1414 return 1;
1415
1416 return 0;
1417}
1418
1402/* 1419/*
1403 * Priority of a process goes from 0..MAX_PRIO-1, valid RT 1420 * Priority of a process goes from 0..MAX_PRIO-1, valid RT
1404 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH 1421 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
@@ -2256,8 +2273,6 @@ __trace_special(void *__tr, void *__data,
2256extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask); 2273extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
2257extern long sched_getaffinity(pid_t pid, struct cpumask *mask); 2274extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
2258 2275
2259extern int sched_mc_power_savings, sched_smt_power_savings;
2260
2261extern void normalize_rt_tasks(void); 2276extern void normalize_rt_tasks(void);
2262 2277
2263#ifdef CONFIG_GROUP_SCHED 2278#ifdef CONFIG_GROUP_SCHED