diff options
Diffstat (limited to 'include/linux/sched.h')
| -rw-r--r-- | include/linux/sched.h | 80 |
1 files changed, 37 insertions, 43 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index dad7f668ebf7..b55e988988b5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -99,7 +99,6 @@ struct futex_pi_state; | |||
| 99 | struct robust_list_head; | 99 | struct robust_list_head; |
| 100 | struct bio_list; | 100 | struct bio_list; |
| 101 | struct fs_struct; | 101 | struct fs_struct; |
| 102 | struct bts_context; | ||
| 103 | struct perf_event_context; | 102 | struct perf_event_context; |
| 104 | 103 | ||
| 105 | /* | 104 | /* |
| @@ -275,11 +274,17 @@ extern cpumask_var_t nohz_cpu_mask; | |||
| 275 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 274 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
| 276 | extern int select_nohz_load_balancer(int cpu); | 275 | extern int select_nohz_load_balancer(int cpu); |
| 277 | extern int get_nohz_load_balancer(void); | 276 | extern int get_nohz_load_balancer(void); |
| 277 | extern int nohz_ratelimit(int cpu); | ||
| 278 | #else | 278 | #else |
| 279 | static inline int select_nohz_load_balancer(int cpu) | 279 | static inline int select_nohz_load_balancer(int cpu) |
| 280 | { | 280 | { |
| 281 | return 0; | 281 | return 0; |
| 282 | } | 282 | } |
| 283 | |||
| 284 | static inline int nohz_ratelimit(int cpu) | ||
| 285 | { | ||
| 286 | return 0; | ||
| 287 | } | ||
| 283 | #endif | 288 | #endif |
| 284 | 289 | ||
| 285 | /* | 290 | /* |
| @@ -954,6 +959,7 @@ struct sched_domain { | |||
| 954 | char *name; | 959 | char *name; |
| 955 | #endif | 960 | #endif |
| 956 | 961 | ||
| 962 | unsigned int span_weight; | ||
| 957 | /* | 963 | /* |
| 958 | * Span of all CPUs in this domain. | 964 | * Span of all CPUs in this domain. |
| 959 | * | 965 | * |
| @@ -1026,12 +1032,17 @@ struct sched_domain; | |||
| 1026 | #define WF_SYNC 0x01 /* waker goes to sleep after wakup */ | 1032 | #define WF_SYNC 0x01 /* waker goes to sleep after wakup */ |
| 1027 | #define WF_FORK 0x02 /* child wakeup after fork */ | 1033 | #define WF_FORK 0x02 /* child wakeup after fork */ |
| 1028 | 1034 | ||
| 1035 | #define ENQUEUE_WAKEUP 1 | ||
| 1036 | #define ENQUEUE_WAKING 2 | ||
| 1037 | #define ENQUEUE_HEAD 4 | ||
| 1038 | |||
| 1039 | #define DEQUEUE_SLEEP 1 | ||
| 1040 | |||
| 1029 | struct sched_class { | 1041 | struct sched_class { |
| 1030 | const struct sched_class *next; | 1042 | const struct sched_class *next; |
| 1031 | 1043 | ||
| 1032 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup, | 1044 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags); |
| 1033 | bool head); | 1045 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags); |
| 1034 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); | ||
| 1035 | void (*yield_task) (struct rq *rq); | 1046 | void (*yield_task) (struct rq *rq); |
| 1036 | 1047 | ||
| 1037 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); | 1048 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); |
| @@ -1040,7 +1051,8 @@ struct sched_class { | |||
| 1040 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); | 1051 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); |
| 1041 | 1052 | ||
| 1042 | #ifdef CONFIG_SMP | 1053 | #ifdef CONFIG_SMP |
| 1043 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); | 1054 | int (*select_task_rq)(struct rq *rq, struct task_struct *p, |
| 1055 | int sd_flag, int flags); | ||
| 1044 | 1056 | ||
| 1045 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | 1057 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); |
| 1046 | void (*post_schedule) (struct rq *this_rq); | 1058 | void (*post_schedule) (struct rq *this_rq); |
| @@ -1077,36 +1089,8 @@ struct load_weight { | |||
| 1077 | unsigned long weight, inv_weight; | 1089 | unsigned long weight, inv_weight; |
| 1078 | }; | 1090 | }; |
| 1079 | 1091 | ||
| 1080 | /* | ||
| 1081 | * CFS stats for a schedulable entity (task, task-group etc) | ||
| 1082 | * | ||
| 1083 | * Current field usage histogram: | ||
| 1084 | * | ||
| 1085 | * 4 se->block_start | ||
| 1086 | * 4 se->run_node | ||
| 1087 | * 4 se->sleep_start | ||
| 1088 | * 6 se->load.weight | ||
| 1089 | */ | ||
| 1090 | struct sched_entity { | ||
| 1091 | struct load_weight load; /* for load-balancing */ | ||
| 1092 | struct rb_node run_node; | ||
| 1093 | struct list_head group_node; | ||
| 1094 | unsigned int on_rq; | ||
| 1095 | |||
| 1096 | u64 exec_start; | ||
| 1097 | u64 sum_exec_runtime; | ||
| 1098 | u64 vruntime; | ||
| 1099 | u64 prev_sum_exec_runtime; | ||
| 1100 | |||
| 1101 | u64 last_wakeup; | ||
| 1102 | u64 avg_overlap; | ||
| 1103 | |||
| 1104 | u64 nr_migrations; | ||
| 1105 | |||
| 1106 | u64 start_runtime; | ||
| 1107 | u64 avg_wakeup; | ||
| 1108 | |||
| 1109 | #ifdef CONFIG_SCHEDSTATS | 1092 | #ifdef CONFIG_SCHEDSTATS |
| 1093 | struct sched_statistics { | ||
| 1110 | u64 wait_start; | 1094 | u64 wait_start; |
| 1111 | u64 wait_max; | 1095 | u64 wait_max; |
| 1112 | u64 wait_count; | 1096 | u64 wait_count; |
| @@ -1138,6 +1122,24 @@ struct sched_entity { | |||
| 1138 | u64 nr_wakeups_affine_attempts; | 1122 | u64 nr_wakeups_affine_attempts; |
| 1139 | u64 nr_wakeups_passive; | 1123 | u64 nr_wakeups_passive; |
| 1140 | u64 nr_wakeups_idle; | 1124 | u64 nr_wakeups_idle; |
| 1125 | }; | ||
| 1126 | #endif | ||
| 1127 | |||
| 1128 | struct sched_entity { | ||
| 1129 | struct load_weight load; /* for load-balancing */ | ||
| 1130 | struct rb_node run_node; | ||
| 1131 | struct list_head group_node; | ||
| 1132 | unsigned int on_rq; | ||
| 1133 | |||
| 1134 | u64 exec_start; | ||
| 1135 | u64 sum_exec_runtime; | ||
| 1136 | u64 vruntime; | ||
| 1137 | u64 prev_sum_exec_runtime; | ||
| 1138 | |||
| 1139 | u64 nr_migrations; | ||
| 1140 | |||
| 1141 | #ifdef CONFIG_SCHEDSTATS | ||
| 1142 | struct sched_statistics statistics; | ||
| 1141 | #endif | 1143 | #endif |
| 1142 | 1144 | ||
| 1143 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1145 | #ifdef CONFIG_FAIR_GROUP_SCHED |
| @@ -1272,12 +1274,6 @@ struct task_struct { | |||
| 1272 | struct list_head ptraced; | 1274 | struct list_head ptraced; |
| 1273 | struct list_head ptrace_entry; | 1275 | struct list_head ptrace_entry; |
| 1274 | 1276 | ||
| 1275 | /* | ||
| 1276 | * This is the tracer handle for the ptrace BTS extension. | ||
| 1277 | * This field actually belongs to the ptracer task. | ||
| 1278 | */ | ||
| 1279 | struct bts_context *bts; | ||
| 1280 | |||
| 1281 | /* PID/PID hash table linkage. */ | 1277 | /* PID/PID hash table linkage. */ |
| 1282 | struct pid_link pids[PIDTYPE_MAX]; | 1278 | struct pid_link pids[PIDTYPE_MAX]; |
| 1283 | struct list_head thread_group; | 1279 | struct list_head thread_group; |
| @@ -1497,7 +1493,6 @@ struct task_struct { | |||
| 1497 | /* bitmask of trace recursion */ | 1493 | /* bitmask of trace recursion */ |
| 1498 | unsigned long trace_recursion; | 1494 | unsigned long trace_recursion; |
| 1499 | #endif /* CONFIG_TRACING */ | 1495 | #endif /* CONFIG_TRACING */ |
| 1500 | unsigned long stack_start; | ||
| 1501 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */ | 1496 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */ |
| 1502 | struct memcg_batch_info { | 1497 | struct memcg_batch_info { |
| 1503 | int do_batch; /* incremented when batch uncharge started */ | 1498 | int do_batch; /* incremented when batch uncharge started */ |
| @@ -1847,6 +1842,7 @@ extern void sched_clock_idle_sleep_event(void); | |||
| 1847 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); | 1842 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); |
| 1848 | 1843 | ||
| 1849 | #ifdef CONFIG_HOTPLUG_CPU | 1844 | #ifdef CONFIG_HOTPLUG_CPU |
| 1845 | extern void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p); | ||
| 1850 | extern void idle_task_exit(void); | 1846 | extern void idle_task_exit(void); |
| 1851 | #else | 1847 | #else |
| 1852 | static inline void idle_task_exit(void) {} | 1848 | static inline void idle_task_exit(void) {} |
| @@ -2123,10 +2119,8 @@ extern void set_task_comm(struct task_struct *tsk, char *from); | |||
| 2123 | extern char *get_task_comm(char *to, struct task_struct *tsk); | 2119 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
| 2124 | 2120 | ||
| 2125 | #ifdef CONFIG_SMP | 2121 | #ifdef CONFIG_SMP |
| 2126 | extern void wait_task_context_switch(struct task_struct *p); | ||
| 2127 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); | 2122 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); |
| 2128 | #else | 2123 | #else |
| 2129 | static inline void wait_task_context_switch(struct task_struct *p) {} | ||
| 2130 | static inline unsigned long wait_task_inactive(struct task_struct *p, | 2124 | static inline unsigned long wait_task_inactive(struct task_struct *p, |
| 2131 | long match_state) | 2125 | long match_state) |
| 2132 | { | 2126 | { |
