diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index abb795afc823..7543a476178b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -448,6 +448,8 @@ static inline void io_schedule(void) | |||
448 | io_schedule_timeout(MAX_SCHEDULE_TIMEOUT); | 448 | io_schedule_timeout(MAX_SCHEDULE_TIMEOUT); |
449 | } | 449 | } |
450 | 450 | ||
451 | void __noreturn do_task_dead(void); | ||
452 | |||
451 | struct nsproxy; | 453 | struct nsproxy; |
452 | struct user_namespace; | 454 | struct user_namespace; |
453 | 455 | ||
@@ -1022,7 +1024,8 @@ extern void wake_up_q(struct wake_q_head *head); | |||
1022 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ | 1024 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ |
1023 | #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ | 1025 | #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ |
1024 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ | 1026 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ |
1025 | #define SD_SHARE_CPUCAPACITY 0x0080 /* Domain members share cpu power */ | 1027 | #define SD_ASYM_CPUCAPACITY 0x0040 /* Groups have different max cpu capacities */ |
1028 | #define SD_SHARE_CPUCAPACITY 0x0080 /* Domain members share cpu capacity */ | ||
1026 | #define SD_SHARE_POWERDOMAIN 0x0100 /* Domain members share power domain */ | 1029 | #define SD_SHARE_POWERDOMAIN 0x0100 /* Domain members share power domain */ |
1027 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ | 1030 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ |
1028 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ | 1031 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ |
@@ -1064,6 +1067,12 @@ extern int sched_domain_level_max; | |||
1064 | 1067 | ||
1065 | struct sched_group; | 1068 | struct sched_group; |
1066 | 1069 | ||
1070 | struct sched_domain_shared { | ||
1071 | atomic_t ref; | ||
1072 | atomic_t nr_busy_cpus; | ||
1073 | int has_idle_cores; | ||
1074 | }; | ||
1075 | |||
1067 | struct sched_domain { | 1076 | struct sched_domain { |
1068 | /* These fields must be setup */ | 1077 | /* These fields must be setup */ |
1069 | struct sched_domain *parent; /* top domain must be null terminated */ | 1078 | struct sched_domain *parent; /* top domain must be null terminated */ |
@@ -1094,6 +1103,8 @@ struct sched_domain { | |||
1094 | u64 max_newidle_lb_cost; | 1103 | u64 max_newidle_lb_cost; |
1095 | unsigned long next_decay_max_lb_cost; | 1104 | unsigned long next_decay_max_lb_cost; |
1096 | 1105 | ||
1106 | u64 avg_scan_cost; /* select_idle_sibling */ | ||
1107 | |||
1097 | #ifdef CONFIG_SCHEDSTATS | 1108 | #ifdef CONFIG_SCHEDSTATS |
1098 | /* load_balance() stats */ | 1109 | /* load_balance() stats */ |
1099 | unsigned int lb_count[CPU_MAX_IDLE_TYPES]; | 1110 | unsigned int lb_count[CPU_MAX_IDLE_TYPES]; |
@@ -1132,6 +1143,7 @@ struct sched_domain { | |||
1132 | void *private; /* used during construction */ | 1143 | void *private; /* used during construction */ |
1133 | struct rcu_head rcu; /* used during destruction */ | 1144 | struct rcu_head rcu; /* used during destruction */ |
1134 | }; | 1145 | }; |
1146 | struct sched_domain_shared *shared; | ||
1135 | 1147 | ||
1136 | unsigned int span_weight; | 1148 | unsigned int span_weight; |
1137 | /* | 1149 | /* |
@@ -1165,6 +1177,7 @@ typedef int (*sched_domain_flags_f)(void); | |||
1165 | 1177 | ||
1166 | struct sd_data { | 1178 | struct sd_data { |
1167 | struct sched_domain **__percpu sd; | 1179 | struct sched_domain **__percpu sd; |
1180 | struct sched_domain_shared **__percpu sds; | ||
1168 | struct sched_group **__percpu sg; | 1181 | struct sched_group **__percpu sg; |
1169 | struct sched_group_capacity **__percpu sgc; | 1182 | struct sched_group_capacity **__percpu sgc; |
1170 | }; | 1183 | }; |
@@ -2597,7 +2610,7 @@ static inline bool is_idle_task(const struct task_struct *p) | |||
2597 | return p->pid == 0; | 2610 | return p->pid == 0; |
2598 | } | 2611 | } |
2599 | extern struct task_struct *curr_task(int cpu); | 2612 | extern struct task_struct *curr_task(int cpu); |
2600 | extern void set_curr_task(int cpu, struct task_struct *p); | 2613 | extern void ia64_set_curr_task(int cpu, struct task_struct *p); |
2601 | 2614 | ||
2602 | void yield(void); | 2615 | void yield(void); |
2603 | 2616 | ||
@@ -3279,7 +3292,11 @@ static inline int signal_pending_state(long state, struct task_struct *p) | |||
3279 | * cond_resched_lock() will drop the spinlock before scheduling, | 3292 | * cond_resched_lock() will drop the spinlock before scheduling, |
3280 | * cond_resched_softirq() will enable bhs before scheduling. | 3293 | * cond_resched_softirq() will enable bhs before scheduling. |
3281 | */ | 3294 | */ |
3295 | #ifndef CONFIG_PREEMPT | ||
3282 | extern int _cond_resched(void); | 3296 | extern int _cond_resched(void); |
3297 | #else | ||
3298 | static inline int _cond_resched(void) { return 0; } | ||
3299 | #endif | ||
3283 | 3300 | ||
3284 | #define cond_resched() ({ \ | 3301 | #define cond_resched() ({ \ |
3285 | ___might_sleep(__FILE__, __LINE__, 0); \ | 3302 | ___might_sleep(__FILE__, __LINE__, 0); \ |
@@ -3309,6 +3326,15 @@ static inline void cond_resched_rcu(void) | |||
3309 | #endif | 3326 | #endif |
3310 | } | 3327 | } |
3311 | 3328 | ||
3329 | static inline unsigned long get_preempt_disable_ip(struct task_struct *p) | ||
3330 | { | ||
3331 | #ifdef CONFIG_DEBUG_PREEMPT | ||
3332 | return p->preempt_disable_ip; | ||
3333 | #else | ||
3334 | return 0; | ||
3335 | #endif | ||
3336 | } | ||
3337 | |||
3312 | /* | 3338 | /* |
3313 | * Does a critical section need to be broken due to another | 3339 | * Does a critical section need to be broken due to another |
3314 | * task waiting?: (technically does not depend on CONFIG_PREEMPT, | 3340 | * task waiting?: (technically does not depend on CONFIG_PREEMPT, |
@@ -3546,15 +3572,20 @@ static inline unsigned long rlimit_max(unsigned int limit) | |||
3546 | return task_rlimit_max(current, limit); | 3572 | return task_rlimit_max(current, limit); |
3547 | } | 3573 | } |
3548 | 3574 | ||
3575 | #define SCHED_CPUFREQ_RT (1U << 0) | ||
3576 | #define SCHED_CPUFREQ_DL (1U << 1) | ||
3577 | #define SCHED_CPUFREQ_IOWAIT (1U << 2) | ||
3578 | |||
3579 | #define SCHED_CPUFREQ_RT_DL (SCHED_CPUFREQ_RT | SCHED_CPUFREQ_DL) | ||
3580 | |||
3549 | #ifdef CONFIG_CPU_FREQ | 3581 | #ifdef CONFIG_CPU_FREQ |
3550 | struct update_util_data { | 3582 | struct update_util_data { |
3551 | void (*func)(struct update_util_data *data, | 3583 | void (*func)(struct update_util_data *data, u64 time, unsigned int flags); |
3552 | u64 time, unsigned long util, unsigned long max); | ||
3553 | }; | 3584 | }; |
3554 | 3585 | ||
3555 | void cpufreq_add_update_util_hook(int cpu, struct update_util_data *data, | 3586 | void cpufreq_add_update_util_hook(int cpu, struct update_util_data *data, |
3556 | void (*func)(struct update_util_data *data, u64 time, | 3587 | void (*func)(struct update_util_data *data, u64 time, |
3557 | unsigned long util, unsigned long max)); | 3588 | unsigned int flags)); |
3558 | void cpufreq_remove_update_util_hook(int cpu); | 3589 | void cpufreq_remove_update_util_hook(int cpu); |
3559 | #endif /* CONFIG_CPU_FREQ */ | 3590 | #endif /* CONFIG_CPU_FREQ */ |
3560 | 3591 | ||