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.h83
1 files changed, 77 insertions, 6 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d6eacda765ca..df5b24ee80b3 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -78,7 +78,6 @@ struct sched_param {
78#include <linux/proportions.h> 78#include <linux/proportions.h>
79#include <linux/seccomp.h> 79#include <linux/seccomp.h>
80#include <linux/rcupdate.h> 80#include <linux/rcupdate.h>
81#include <linux/futex.h>
82#include <linux/rtmutex.h> 81#include <linux/rtmutex.h>
83 82
84#include <linux/time.h> 83#include <linux/time.h>
@@ -88,11 +87,13 @@ struct sched_param {
88#include <linux/hrtimer.h> 87#include <linux/hrtimer.h>
89#include <linux/task_io_accounting.h> 88#include <linux/task_io_accounting.h>
90#include <linux/kobject.h> 89#include <linux/kobject.h>
90#include <linux/latencytop.h>
91 91
92#include <asm/processor.h> 92#include <asm/processor.h>
93 93
94struct exec_domain; 94struct exec_domain;
95struct futex_pi_state; 95struct futex_pi_state;
96struct robust_list_head;
96struct bio; 97struct bio;
97 98
98/* 99/*
@@ -230,6 +231,8 @@ static inline int select_nohz_load_balancer(int cpu)
230} 231}
231#endif 232#endif
232 233
234extern unsigned long rt_needs_cpu(int cpu);
235
233/* 236/*
234 * Only dump TASK_* tasks. (0 for all tasks) 237 * Only dump TASK_* tasks. (0 for all tasks)
235 */ 238 */
@@ -257,13 +260,19 @@ extern void trap_init(void);
257extern void account_process_tick(struct task_struct *task, int user); 260extern void account_process_tick(struct task_struct *task, int user);
258extern void update_process_times(int user); 261extern void update_process_times(int user);
259extern void scheduler_tick(void); 262extern void scheduler_tick(void);
263extern void hrtick_resched(void);
264
265extern void sched_show_task(struct task_struct *p);
260 266
261#ifdef CONFIG_DETECT_SOFTLOCKUP 267#ifdef CONFIG_DETECT_SOFTLOCKUP
262extern void softlockup_tick(void); 268extern void softlockup_tick(void);
263extern void spawn_softlockup_task(void); 269extern void spawn_softlockup_task(void);
264extern void touch_softlockup_watchdog(void); 270extern void touch_softlockup_watchdog(void);
265extern void touch_all_softlockup_watchdogs(void); 271extern void touch_all_softlockup_watchdogs(void);
266extern int softlockup_thresh; 272extern unsigned long softlockup_thresh;
273extern unsigned long sysctl_hung_task_check_count;
274extern unsigned long sysctl_hung_task_timeout_secs;
275extern unsigned long sysctl_hung_task_warnings;
267#else 276#else
268static inline void softlockup_tick(void) 277static inline void softlockup_tick(void)
269{ 278{
@@ -822,6 +831,7 @@ struct sched_class {
822 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup); 831 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup);
823 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); 832 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
824 void (*yield_task) (struct rq *rq); 833 void (*yield_task) (struct rq *rq);
834 int (*select_task_rq)(struct task_struct *p, int sync);
825 835
826 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p); 836 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p);
827 837
@@ -837,11 +847,25 @@ struct sched_class {
837 int (*move_one_task) (struct rq *this_rq, int this_cpu, 847 int (*move_one_task) (struct rq *this_rq, int this_cpu,
838 struct rq *busiest, struct sched_domain *sd, 848 struct rq *busiest, struct sched_domain *sd,
839 enum cpu_idle_type idle); 849 enum cpu_idle_type idle);
850 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
851 void (*post_schedule) (struct rq *this_rq);
852 void (*task_wake_up) (struct rq *this_rq, struct task_struct *task);
840#endif 853#endif
841 854
842 void (*set_curr_task) (struct rq *rq); 855 void (*set_curr_task) (struct rq *rq);
843 void (*task_tick) (struct rq *rq, struct task_struct *p); 856 void (*task_tick) (struct rq *rq, struct task_struct *p, int queued);
844 void (*task_new) (struct rq *rq, struct task_struct *p); 857 void (*task_new) (struct rq *rq, struct task_struct *p);
858 void (*set_cpus_allowed)(struct task_struct *p, cpumask_t *newmask);
859
860 void (*join_domain)(struct rq *rq);
861 void (*leave_domain)(struct rq *rq);
862
863 void (*switched_from) (struct rq *this_rq, struct task_struct *task,
864 int running);
865 void (*switched_to) (struct rq *this_rq, struct task_struct *task,
866 int running);
867 void (*prio_changed) (struct rq *this_rq, struct task_struct *task,
868 int oldprio, int running);
845}; 869};
846 870
847struct load_weight { 871struct load_weight {
@@ -871,6 +895,8 @@ struct sched_entity {
871#ifdef CONFIG_SCHEDSTATS 895#ifdef CONFIG_SCHEDSTATS
872 u64 wait_start; 896 u64 wait_start;
873 u64 wait_max; 897 u64 wait_max;
898 u64 wait_count;
899 u64 wait_sum;
874 900
875 u64 sleep_start; 901 u64 sleep_start;
876 u64 sleep_max; 902 u64 sleep_max;
@@ -909,6 +935,21 @@ struct sched_entity {
909#endif 935#endif
910}; 936};
911 937
938struct sched_rt_entity {
939 struct list_head run_list;
940 unsigned int time_slice;
941 unsigned long timeout;
942 int nr_cpus_allowed;
943
944#ifdef CONFIG_FAIR_GROUP_SCHED
945 struct sched_rt_entity *parent;
946 /* rq on which this entity is (to be) queued: */
947 struct rt_rq *rt_rq;
948 /* rq "owned" by this entity/group: */
949 struct rt_rq *my_q;
950#endif
951};
952
912struct task_struct { 953struct task_struct {
913 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ 954 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
914 void *stack; 955 void *stack;
@@ -925,9 +966,9 @@ struct task_struct {
925#endif 966#endif
926 967
927 int prio, static_prio, normal_prio; 968 int prio, static_prio, normal_prio;
928 struct list_head run_list;
929 const struct sched_class *sched_class; 969 const struct sched_class *sched_class;
930 struct sched_entity se; 970 struct sched_entity se;
971 struct sched_rt_entity rt;
931 972
932#ifdef CONFIG_PREEMPT_NOTIFIERS 973#ifdef CONFIG_PREEMPT_NOTIFIERS
933 /* list of struct preempt_notifier: */ 974 /* list of struct preempt_notifier: */
@@ -951,7 +992,11 @@ struct task_struct {
951 992
952 unsigned int policy; 993 unsigned int policy;
953 cpumask_t cpus_allowed; 994 cpumask_t cpus_allowed;
954 unsigned int time_slice; 995
996#ifdef CONFIG_PREEMPT_RCU
997 int rcu_read_lock_nesting;
998 int rcu_flipctr_idx;
999#endif /* #ifdef CONFIG_PREEMPT_RCU */
955 1000
956#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) 1001#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
957 struct sched_info sched_info; 1002 struct sched_info sched_info;
@@ -1041,6 +1086,11 @@ struct task_struct {
1041/* ipc stuff */ 1086/* ipc stuff */
1042 struct sysv_sem sysvsem; 1087 struct sysv_sem sysvsem;
1043#endif 1088#endif
1089#ifdef CONFIG_DETECT_SOFTLOCKUP
1090/* hung task detection */
1091 unsigned long last_switch_timestamp;
1092 unsigned long last_switch_count;
1093#endif
1044/* CPU-specific state of this task */ 1094/* CPU-specific state of this task */
1045 struct thread_struct thread; 1095 struct thread_struct thread;
1046/* filesystem information */ 1096/* filesystem information */
@@ -1173,6 +1223,10 @@ struct task_struct {
1173 int make_it_fail; 1223 int make_it_fail;
1174#endif 1224#endif
1175 struct prop_local_single dirties; 1225 struct prop_local_single dirties;
1226#ifdef CONFIG_LATENCYTOP
1227 int latency_record_count;
1228 struct latency_record latency_record[LT_SAVECOUNT];
1229#endif
1176}; 1230};
1177 1231
1178/* 1232/*
@@ -1453,6 +1507,12 @@ extern unsigned int sysctl_sched_child_runs_first;
1453extern unsigned int sysctl_sched_features; 1507extern unsigned int sysctl_sched_features;
1454extern unsigned int sysctl_sched_migration_cost; 1508extern unsigned int sysctl_sched_migration_cost;
1455extern unsigned int sysctl_sched_nr_migrate; 1509extern unsigned int sysctl_sched_nr_migrate;
1510extern unsigned int sysctl_sched_rt_period;
1511extern unsigned int sysctl_sched_rt_ratio;
1512#if defined(CONFIG_FAIR_GROUP_SCHED) && defined(CONFIG_SMP)
1513extern unsigned int sysctl_sched_min_bal_int_shares;
1514extern unsigned int sysctl_sched_max_bal_int_shares;
1515#endif
1456 1516
1457int sched_nr_latency_handler(struct ctl_table *table, int write, 1517int sched_nr_latency_handler(struct ctl_table *table, int write,
1458 struct file *file, void __user *buffer, size_t *length, 1518 struct file *file, void __user *buffer, size_t *length,
@@ -1845,7 +1905,18 @@ static inline int need_resched(void)
1845 * cond_resched_lock() will drop the spinlock before scheduling, 1905 * cond_resched_lock() will drop the spinlock before scheduling,
1846 * cond_resched_softirq() will enable bhs before scheduling. 1906 * cond_resched_softirq() will enable bhs before scheduling.
1847 */ 1907 */
1848extern int cond_resched(void); 1908#ifdef CONFIG_PREEMPT
1909static inline int cond_resched(void)
1910{
1911 return 0;
1912}
1913#else
1914extern int _cond_resched(void);
1915static inline int cond_resched(void)
1916{
1917 return _cond_resched();
1918}
1919#endif
1849extern int cond_resched_lock(spinlock_t * lock); 1920extern int cond_resched_lock(spinlock_t * lock);
1850extern int cond_resched_softirq(void); 1921extern int cond_resched_softirq(void);
1851 1922