diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 64 |
1 files changed, 28 insertions, 36 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 18d63cea2848..12211e1666e2 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -360,7 +360,7 @@ extern signed long schedule_timeout_interruptible(signed long timeout); | |||
360 | extern signed long schedule_timeout_killable(signed long timeout); | 360 | extern signed long schedule_timeout_killable(signed long timeout); |
361 | extern signed long schedule_timeout_uninterruptible(signed long timeout); | 361 | extern signed long schedule_timeout_uninterruptible(signed long timeout); |
362 | asmlinkage void schedule(void); | 362 | asmlinkage void schedule(void); |
363 | extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); | 363 | extern int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner); |
364 | 364 | ||
365 | struct nsproxy; | 365 | struct nsproxy; |
366 | struct user_namespace; | 366 | struct user_namespace; |
@@ -731,10 +731,6 @@ struct sched_info { | |||
731 | /* timestamps */ | 731 | /* timestamps */ |
732 | unsigned long long last_arrival,/* when we last ran on a cpu */ | 732 | unsigned long long last_arrival,/* when we last ran on a cpu */ |
733 | last_queued; /* when we were last queued to run */ | 733 | last_queued; /* when we were last queued to run */ |
734 | #ifdef CONFIG_SCHEDSTATS | ||
735 | /* BKL stats */ | ||
736 | unsigned int bkl_count; | ||
737 | #endif | ||
738 | }; | 734 | }; |
739 | #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ | 735 | #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ |
740 | 736 | ||
@@ -868,6 +864,7 @@ static inline int sd_power_saving_flags(void) | |||
868 | 864 | ||
869 | struct sched_group { | 865 | struct sched_group { |
870 | struct sched_group *next; /* Must be a circular list */ | 866 | struct sched_group *next; /* Must be a circular list */ |
867 | atomic_t ref; | ||
871 | 868 | ||
872 | /* | 869 | /* |
873 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a | 870 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a |
@@ -882,9 +879,6 @@ struct sched_group { | |||
882 | * NOTE: this field is variable length. (Allocated dynamically | 879 | * NOTE: this field is variable length. (Allocated dynamically |
883 | * by attaching extra space to the end of the structure, | 880 | * by attaching extra space to the end of the structure, |
884 | * depending on how many CPUs the kernel has booted up with) | 881 | * depending on how many CPUs the kernel has booted up with) |
885 | * | ||
886 | * It is also be embedded into static data structures at build | ||
887 | * time. (See 'struct static_sched_group' in kernel/sched.c) | ||
888 | */ | 882 | */ |
889 | unsigned long cpumask[0]; | 883 | unsigned long cpumask[0]; |
890 | }; | 884 | }; |
@@ -894,17 +888,6 @@ static inline struct cpumask *sched_group_cpus(struct sched_group *sg) | |||
894 | return to_cpumask(sg->cpumask); | 888 | return to_cpumask(sg->cpumask); |
895 | } | 889 | } |
896 | 890 | ||
897 | enum sched_domain_level { | ||
898 | SD_LV_NONE = 0, | ||
899 | SD_LV_SIBLING, | ||
900 | SD_LV_MC, | ||
901 | SD_LV_BOOK, | ||
902 | SD_LV_CPU, | ||
903 | SD_LV_NODE, | ||
904 | SD_LV_ALLNODES, | ||
905 | SD_LV_MAX | ||
906 | }; | ||
907 | |||
908 | struct sched_domain_attr { | 891 | struct sched_domain_attr { |
909 | int relax_domain_level; | 892 | int relax_domain_level; |
910 | }; | 893 | }; |
@@ -913,6 +896,8 @@ struct sched_domain_attr { | |||
913 | .relax_domain_level = -1, \ | 896 | .relax_domain_level = -1, \ |
914 | } | 897 | } |
915 | 898 | ||
899 | extern int sched_domain_level_max; | ||
900 | |||
916 | struct sched_domain { | 901 | struct sched_domain { |
917 | /* These fields must be setup */ | 902 | /* These fields must be setup */ |
918 | struct sched_domain *parent; /* top domain must be null terminated */ | 903 | struct sched_domain *parent; /* top domain must be null terminated */ |
@@ -930,7 +915,7 @@ struct sched_domain { | |||
930 | unsigned int forkexec_idx; | 915 | unsigned int forkexec_idx; |
931 | unsigned int smt_gain; | 916 | unsigned int smt_gain; |
932 | int flags; /* See SD_* */ | 917 | int flags; /* See SD_* */ |
933 | enum sched_domain_level level; | 918 | int level; |
934 | 919 | ||
935 | /* Runtime fields. */ | 920 | /* Runtime fields. */ |
936 | unsigned long last_balance; /* init to jiffies. units in jiffies */ | 921 | unsigned long last_balance; /* init to jiffies. units in jiffies */ |
@@ -973,6 +958,10 @@ struct sched_domain { | |||
973 | #ifdef CONFIG_SCHED_DEBUG | 958 | #ifdef CONFIG_SCHED_DEBUG |
974 | char *name; | 959 | char *name; |
975 | #endif | 960 | #endif |
961 | union { | ||
962 | void *private; /* used during construction */ | ||
963 | struct rcu_head rcu; /* used during destruction */ | ||
964 | }; | ||
976 | 965 | ||
977 | unsigned int span_weight; | 966 | unsigned int span_weight; |
978 | /* | 967 | /* |
@@ -981,9 +970,6 @@ struct sched_domain { | |||
981 | * NOTE: this field is variable length. (Allocated dynamically | 970 | * NOTE: this field is variable length. (Allocated dynamically |
982 | * by attaching extra space to the end of the structure, | 971 | * by attaching extra space to the end of the structure, |
983 | * depending on how many CPUs the kernel has booted up with) | 972 | * depending on how many CPUs the kernel has booted up with) |
984 | * | ||
985 | * It is also be embedded into static data structures at build | ||
986 | * time. (See 'struct static_sched_domain' in kernel/sched.c) | ||
987 | */ | 973 | */ |
988 | unsigned long span[0]; | 974 | unsigned long span[0]; |
989 | }; | 975 | }; |
@@ -1048,8 +1034,12 @@ struct sched_domain; | |||
1048 | #define WF_FORK 0x02 /* child wakeup after fork */ | 1034 | #define WF_FORK 0x02 /* child wakeup after fork */ |
1049 | 1035 | ||
1050 | #define ENQUEUE_WAKEUP 1 | 1036 | #define ENQUEUE_WAKEUP 1 |
1051 | #define ENQUEUE_WAKING 2 | 1037 | #define ENQUEUE_HEAD 2 |
1052 | #define ENQUEUE_HEAD 4 | 1038 | #ifdef CONFIG_SMP |
1039 | #define ENQUEUE_WAKING 4 /* sched_class::task_waking was called */ | ||
1040 | #else | ||
1041 | #define ENQUEUE_WAKING 0 | ||
1042 | #endif | ||
1053 | 1043 | ||
1054 | #define DEQUEUE_SLEEP 1 | 1044 | #define DEQUEUE_SLEEP 1 |
1055 | 1045 | ||
@@ -1067,12 +1057,11 @@ struct sched_class { | |||
1067 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); | 1057 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); |
1068 | 1058 | ||
1069 | #ifdef CONFIG_SMP | 1059 | #ifdef CONFIG_SMP |
1070 | int (*select_task_rq)(struct rq *rq, struct task_struct *p, | 1060 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); |
1071 | int sd_flag, int flags); | ||
1072 | 1061 | ||
1073 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | 1062 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); |
1074 | void (*post_schedule) (struct rq *this_rq); | 1063 | void (*post_schedule) (struct rq *this_rq); |
1075 | void (*task_waking) (struct rq *this_rq, struct task_struct *task); | 1064 | void (*task_waking) (struct task_struct *task); |
1076 | void (*task_woken) (struct rq *this_rq, struct task_struct *task); | 1065 | void (*task_woken) (struct rq *this_rq, struct task_struct *task); |
1077 | 1066 | ||
1078 | void (*set_cpus_allowed)(struct task_struct *p, | 1067 | void (*set_cpus_allowed)(struct task_struct *p, |
@@ -1197,13 +1186,11 @@ struct task_struct { | |||
1197 | unsigned int flags; /* per process flags, defined below */ | 1186 | unsigned int flags; /* per process flags, defined below */ |
1198 | unsigned int ptrace; | 1187 | unsigned int ptrace; |
1199 | 1188 | ||
1200 | int lock_depth; /* BKL lock depth */ | ||
1201 | |||
1202 | #ifdef CONFIG_SMP | 1189 | #ifdef CONFIG_SMP |
1203 | #ifdef __ARCH_WANT_UNLOCKED_CTXSW | 1190 | struct task_struct *wake_entry; |
1204 | int oncpu; | 1191 | int on_cpu; |
1205 | #endif | ||
1206 | #endif | 1192 | #endif |
1193 | int on_rq; | ||
1207 | 1194 | ||
1208 | int prio, static_prio, normal_prio; | 1195 | int prio, static_prio, normal_prio; |
1209 | unsigned int rt_priority; | 1196 | unsigned int rt_priority; |
@@ -1274,6 +1261,7 @@ struct task_struct { | |||
1274 | 1261 | ||
1275 | /* Revert to default priority/policy when forking */ | 1262 | /* Revert to default priority/policy when forking */ |
1276 | unsigned sched_reset_on_fork:1; | 1263 | unsigned sched_reset_on_fork:1; |
1264 | unsigned sched_contributes_to_load:1; | ||
1277 | 1265 | ||
1278 | pid_t pid; | 1266 | pid_t pid; |
1279 | pid_t tgid; | 1267 | pid_t tgid; |
@@ -1537,6 +1525,9 @@ struct task_struct { | |||
1537 | unsigned long memsw_nr_pages; /* uncharged mem+swap usage */ | 1525 | unsigned long memsw_nr_pages; /* uncharged mem+swap usage */ |
1538 | } memcg_batch; | 1526 | } memcg_batch; |
1539 | #endif | 1527 | #endif |
1528 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
1529 | atomic_t ptrace_bp_refcnt; | ||
1530 | #endif | ||
1540 | }; | 1531 | }; |
1541 | 1532 | ||
1542 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ | 1533 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ |
@@ -2060,14 +2051,13 @@ extern void xtime_update(unsigned long ticks); | |||
2060 | 2051 | ||
2061 | extern int wake_up_state(struct task_struct *tsk, unsigned int state); | 2052 | extern int wake_up_state(struct task_struct *tsk, unsigned int state); |
2062 | extern int wake_up_process(struct task_struct *tsk); | 2053 | extern int wake_up_process(struct task_struct *tsk); |
2063 | extern void wake_up_new_task(struct task_struct *tsk, | 2054 | extern void wake_up_new_task(struct task_struct *tsk); |
2064 | unsigned long clone_flags); | ||
2065 | #ifdef CONFIG_SMP | 2055 | #ifdef CONFIG_SMP |
2066 | extern void kick_process(struct task_struct *tsk); | 2056 | extern void kick_process(struct task_struct *tsk); |
2067 | #else | 2057 | #else |
2068 | static inline void kick_process(struct task_struct *tsk) { } | 2058 | static inline void kick_process(struct task_struct *tsk) { } |
2069 | #endif | 2059 | #endif |
2070 | extern void sched_fork(struct task_struct *p, int clone_flags); | 2060 | extern void sched_fork(struct task_struct *p); |
2071 | extern void sched_dead(struct task_struct *p); | 2061 | extern void sched_dead(struct task_struct *p); |
2072 | 2062 | ||
2073 | extern void proc_caches_init(void); | 2063 | extern void proc_caches_init(void); |
@@ -2192,8 +2182,10 @@ extern void set_task_comm(struct task_struct *tsk, char *from); | |||
2192 | extern char *get_task_comm(char *to, struct task_struct *tsk); | 2182 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
2193 | 2183 | ||
2194 | #ifdef CONFIG_SMP | 2184 | #ifdef CONFIG_SMP |
2185 | void scheduler_ipi(void); | ||
2195 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); | 2186 | extern unsigned long wait_task_inactive(struct task_struct *, long match_state); |
2196 | #else | 2187 | #else |
2188 | static inline void scheduler_ipi(void) { } | ||
2197 | static inline unsigned long wait_task_inactive(struct task_struct *p, | 2189 | static inline unsigned long wait_task_inactive(struct task_struct *p, |
2198 | long match_state) | 2190 | long match_state) |
2199 | { | 2191 | { |