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.h70
1 files changed, 37 insertions, 33 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 28b71ee133f0..b55e988988b5 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -274,11 +274,17 @@ extern cpumask_var_t nohz_cpu_mask;
274#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 274#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
275extern int select_nohz_load_balancer(int cpu); 275extern int select_nohz_load_balancer(int cpu);
276extern int get_nohz_load_balancer(void); 276extern int get_nohz_load_balancer(void);
277extern int nohz_ratelimit(int cpu);
277#else 278#else
278static inline int select_nohz_load_balancer(int cpu) 279static inline int select_nohz_load_balancer(int cpu)
279{ 280{
280 return 0; 281 return 0;
281} 282}
283
284static inline int nohz_ratelimit(int cpu)
285{
286 return 0;
287}
282#endif 288#endif
283 289
284/* 290/*
@@ -953,6 +959,7 @@ struct sched_domain {
953 char *name; 959 char *name;
954#endif 960#endif
955 961
962 unsigned int span_weight;
956 /* 963 /*
957 * Span of all CPUs in this domain. 964 * Span of all CPUs in this domain.
958 * 965 *
@@ -1025,12 +1032,17 @@ struct sched_domain;
1025#define WF_SYNC 0x01 /* waker goes to sleep after wakup */ 1032#define WF_SYNC 0x01 /* waker goes to sleep after wakup */
1026#define WF_FORK 0x02 /* child wakeup after fork */ 1033#define WF_FORK 0x02 /* child wakeup after fork */
1027 1034
1035#define ENQUEUE_WAKEUP 1
1036#define ENQUEUE_WAKING 2
1037#define ENQUEUE_HEAD 4
1038
1039#define DEQUEUE_SLEEP 1
1040
1028struct sched_class { 1041struct sched_class {
1029 const struct sched_class *next; 1042 const struct sched_class *next;
1030 1043
1031 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);
1032 bool head); 1045 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags);
1033 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
1034 void (*yield_task) (struct rq *rq); 1046 void (*yield_task) (struct rq *rq);
1035 1047
1036 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);
@@ -1039,7 +1051,8 @@ struct sched_class {
1039 void (*put_prev_task) (struct rq *rq, struct task_struct *p); 1051 void (*put_prev_task) (struct rq *rq, struct task_struct *p);
1040 1052
1041#ifdef CONFIG_SMP 1053#ifdef CONFIG_SMP
1042 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);
1043 1056
1044 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); 1057 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
1045 void (*post_schedule) (struct rq *this_rq); 1058 void (*post_schedule) (struct rq *this_rq);
@@ -1076,36 +1089,8 @@ struct load_weight {
1076 unsigned long weight, inv_weight; 1089 unsigned long weight, inv_weight;
1077}; 1090};
1078 1091
1079/*
1080 * CFS stats for a schedulable entity (task, task-group etc)
1081 *
1082 * Current field usage histogram:
1083 *
1084 * 4 se->block_start
1085 * 4 se->run_node
1086 * 4 se->sleep_start
1087 * 6 se->load.weight
1088 */
1089struct sched_entity {
1090 struct load_weight load; /* for load-balancing */
1091 struct rb_node run_node;
1092 struct list_head group_node;
1093 unsigned int on_rq;
1094
1095 u64 exec_start;
1096 u64 sum_exec_runtime;
1097 u64 vruntime;
1098 u64 prev_sum_exec_runtime;
1099
1100 u64 last_wakeup;
1101 u64 avg_overlap;
1102
1103 u64 nr_migrations;
1104
1105 u64 start_runtime;
1106 u64 avg_wakeup;
1107
1108#ifdef CONFIG_SCHEDSTATS 1092#ifdef CONFIG_SCHEDSTATS
1093struct sched_statistics {
1109 u64 wait_start; 1094 u64 wait_start;
1110 u64 wait_max; 1095 u64 wait_max;
1111 u64 wait_count; 1096 u64 wait_count;
@@ -1137,6 +1122,24 @@ struct sched_entity {
1137 u64 nr_wakeups_affine_attempts; 1122 u64 nr_wakeups_affine_attempts;
1138 u64 nr_wakeups_passive; 1123 u64 nr_wakeups_passive;
1139 u64 nr_wakeups_idle; 1124 u64 nr_wakeups_idle;
1125};
1126#endif
1127
1128struct 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;
1140#endif 1143#endif
1141 1144
1142#ifdef CONFIG_FAIR_GROUP_SCHED 1145#ifdef CONFIG_FAIR_GROUP_SCHED
@@ -1839,6 +1842,7 @@ extern void sched_clock_idle_sleep_event(void);
1839extern void sched_clock_idle_wakeup_event(u64 delta_ns); 1842extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1840 1843
1841#ifdef CONFIG_HOTPLUG_CPU 1844#ifdef CONFIG_HOTPLUG_CPU
1845extern void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p);
1842extern void idle_task_exit(void); 1846extern void idle_task_exit(void);
1843#else 1847#else
1844static inline void idle_task_exit(void) {} 1848static inline void idle_task_exit(void) {}