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.h54
1 files changed, 44 insertions, 10 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d0036e52a24..777cd01e240 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -143,7 +143,7 @@ extern unsigned long nr_iowait_cpu(int cpu);
143extern unsigned long this_cpu_load(void); 143extern unsigned long this_cpu_load(void);
144 144
145 145
146extern void calc_global_load(void); 146extern void calc_global_load(unsigned long ticks);
147 147
148extern unsigned long get_parent_ip(unsigned long addr); 148extern unsigned long get_parent_ip(unsigned long addr);
149 149
@@ -316,6 +316,7 @@ extern int proc_dowatchdog_thresh(struct ctl_table *table, int write,
316 size_t *lenp, loff_t *ppos); 316 size_t *lenp, loff_t *ppos);
317extern unsigned int softlockup_panic; 317extern unsigned int softlockup_panic;
318extern int softlockup_thresh; 318extern int softlockup_thresh;
319void lockup_detector_init(void);
319#else 320#else
320static inline void touch_softlockup_watchdog(void) 321static inline void touch_softlockup_watchdog(void)
321{ 322{
@@ -326,6 +327,9 @@ static inline void touch_softlockup_watchdog_sync(void)
326static inline void touch_all_softlockup_watchdogs(void) 327static inline void touch_all_softlockup_watchdogs(void)
327{ 328{
328} 329}
330static inline void lockup_detector_init(void)
331{
332}
329#endif 333#endif
330 334
331#ifdef CONFIG_DETECT_HUNG_TASK 335#ifdef CONFIG_DETECT_HUNG_TASK
@@ -509,6 +513,8 @@ struct thread_group_cputimer {
509 spinlock_t lock; 513 spinlock_t lock;
510}; 514};
511 515
516struct autogroup;
517
512/* 518/*
513 * NOTE! "signal_struct" does not have it's own 519 * NOTE! "signal_struct" does not have it's own
514 * locking, because a shared signal_struct always 520 * locking, because a shared signal_struct always
@@ -576,6 +582,9 @@ struct signal_struct {
576 582
577 struct tty_struct *tty; /* NULL if no tty */ 583 struct tty_struct *tty; /* NULL if no tty */
578 584
585#ifdef CONFIG_SCHED_AUTOGROUP
586 struct autogroup *autogroup;
587#endif
579 /* 588 /*
580 * Cumulative resource counters for dead threads in the group, 589 * Cumulative resource counters for dead threads in the group,
581 * and for reaped dead child processes forked by this group. 590 * and for reaped dead child processes forked by this group.
@@ -862,6 +871,7 @@ struct sched_group {
862 * single CPU. 871 * single CPU.
863 */ 872 */
864 unsigned int cpu_power, cpu_power_orig; 873 unsigned int cpu_power, cpu_power_orig;
874 unsigned int group_weight;
865 875
866 /* 876 /*
867 * The CPUs this group covers. 877 * The CPUs this group covers.
@@ -1228,13 +1238,18 @@ struct task_struct {
1228#ifdef CONFIG_TREE_PREEMPT_RCU 1238#ifdef CONFIG_TREE_PREEMPT_RCU
1229 struct rcu_node *rcu_blocked_node; 1239 struct rcu_node *rcu_blocked_node;
1230#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 1240#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
1241#ifdef CONFIG_RCU_BOOST
1242 struct rt_mutex *rcu_boost_mutex;
1243#endif /* #ifdef CONFIG_RCU_BOOST */
1231 1244
1232#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) 1245#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
1233 struct sched_info sched_info; 1246 struct sched_info sched_info;
1234#endif 1247#endif
1235 1248
1236 struct list_head tasks; 1249 struct list_head tasks;
1250#ifdef CONFIG_SMP
1237 struct plist_node pushable_tasks; 1251 struct plist_node pushable_tasks;
1252#endif
1238 1253
1239 struct mm_struct *mm, *active_mm; 1254 struct mm_struct *mm, *active_mm;
1240#if defined(SPLIT_RSS_COUNTING) 1255#if defined(SPLIT_RSS_COUNTING)
@@ -1758,7 +1773,8 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1758#ifdef CONFIG_PREEMPT_RCU 1773#ifdef CONFIG_PREEMPT_RCU
1759 1774
1760#define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ 1775#define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */
1761#define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */ 1776#define RCU_READ_UNLOCK_BOOSTED (1 << 1) /* boosted while in RCU read-side. */
1777#define RCU_READ_UNLOCK_NEED_QS (1 << 2) /* RCU core needs CPU response. */
1762 1778
1763static inline void rcu_copy_process(struct task_struct *p) 1779static inline void rcu_copy_process(struct task_struct *p)
1764{ 1780{
@@ -1766,7 +1782,10 @@ static inline void rcu_copy_process(struct task_struct *p)
1766 p->rcu_read_unlock_special = 0; 1782 p->rcu_read_unlock_special = 0;
1767#ifdef CONFIG_TREE_PREEMPT_RCU 1783#ifdef CONFIG_TREE_PREEMPT_RCU
1768 p->rcu_blocked_node = NULL; 1784 p->rcu_blocked_node = NULL;
1769#endif 1785#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
1786#ifdef CONFIG_RCU_BOOST
1787 p->rcu_boost_mutex = NULL;
1788#endif /* #ifdef CONFIG_RCU_BOOST */
1770 INIT_LIST_HEAD(&p->rcu_node_entry); 1789 INIT_LIST_HEAD(&p->rcu_node_entry);
1771} 1790}
1772 1791
@@ -1871,14 +1890,11 @@ extern void sched_clock_idle_sleep_event(void);
1871extern void sched_clock_idle_wakeup_event(u64 delta_ns); 1890extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1872 1891
1873#ifdef CONFIG_HOTPLUG_CPU 1892#ifdef CONFIG_HOTPLUG_CPU
1874extern void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p);
1875extern void idle_task_exit(void); 1893extern void idle_task_exit(void);
1876#else 1894#else
1877static inline void idle_task_exit(void) {} 1895static inline void idle_task_exit(void) {}
1878#endif 1896#endif
1879 1897
1880extern void sched_idle_next(void);
1881
1882#if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) 1898#if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)
1883extern void wake_up_idle_cpu(int cpu); 1899extern void wake_up_idle_cpu(int cpu);
1884#else 1900#else
@@ -1888,8 +1904,6 @@ static inline void wake_up_idle_cpu(int cpu) { }
1888extern unsigned int sysctl_sched_latency; 1904extern unsigned int sysctl_sched_latency;
1889extern unsigned int sysctl_sched_min_granularity; 1905extern unsigned int sysctl_sched_min_granularity;
1890extern unsigned int sysctl_sched_wakeup_granularity; 1906extern unsigned int sysctl_sched_wakeup_granularity;
1891extern unsigned int sysctl_sched_shares_ratelimit;
1892extern unsigned int sysctl_sched_shares_thresh;
1893extern unsigned int sysctl_sched_child_runs_first; 1907extern unsigned int sysctl_sched_child_runs_first;
1894 1908
1895enum sched_tunable_scaling { 1909enum sched_tunable_scaling {
@@ -1905,6 +1919,7 @@ extern unsigned int sysctl_sched_migration_cost;
1905extern unsigned int sysctl_sched_nr_migrate; 1919extern unsigned int sysctl_sched_nr_migrate;
1906extern unsigned int sysctl_sched_time_avg; 1920extern unsigned int sysctl_sched_time_avg;
1907extern unsigned int sysctl_timer_migration; 1921extern unsigned int sysctl_timer_migration;
1922extern unsigned int sysctl_sched_shares_window;
1908 1923
1909int sched_proc_update_handler(struct ctl_table *table, int write, 1924int sched_proc_update_handler(struct ctl_table *table, int write,
1910 void __user *buffer, size_t *length, 1925 void __user *buffer, size_t *length,
@@ -1930,6 +1945,24 @@ int sched_rt_handler(struct ctl_table *table, int write,
1930 1945
1931extern unsigned int sysctl_sched_compat_yield; 1946extern unsigned int sysctl_sched_compat_yield;
1932 1947
1948#ifdef CONFIG_SCHED_AUTOGROUP
1949extern unsigned int sysctl_sched_autogroup_enabled;
1950
1951extern void sched_autogroup_create_attach(struct task_struct *p);
1952extern void sched_autogroup_detach(struct task_struct *p);
1953extern void sched_autogroup_fork(struct signal_struct *sig);
1954extern void sched_autogroup_exit(struct signal_struct *sig);
1955#ifdef CONFIG_PROC_FS
1956extern void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m);
1957extern int proc_sched_autogroup_set_nice(struct task_struct *p, int *nice);
1958#endif
1959#else
1960static inline void sched_autogroup_create_attach(struct task_struct *p) { }
1961static inline void sched_autogroup_detach(struct task_struct *p) { }
1962static inline void sched_autogroup_fork(struct signal_struct *sig) { }
1963static inline void sched_autogroup_exit(struct signal_struct *sig) { }
1964#endif
1965
1933#ifdef CONFIG_RT_MUTEXES 1966#ifdef CONFIG_RT_MUTEXES
1934extern int rt_mutex_getprio(struct task_struct *p); 1967extern int rt_mutex_getprio(struct task_struct *p);
1935extern void rt_mutex_setprio(struct task_struct *p, int prio); 1968extern void rt_mutex_setprio(struct task_struct *p, int prio);
@@ -1948,9 +1981,10 @@ extern int task_nice(const struct task_struct *p);
1948extern int can_nice(const struct task_struct *p, const int nice); 1981extern int can_nice(const struct task_struct *p, const int nice);
1949extern int task_curr(const struct task_struct *p); 1982extern int task_curr(const struct task_struct *p);
1950extern int idle_cpu(int cpu); 1983extern int idle_cpu(int cpu);
1951extern int sched_setscheduler(struct task_struct *, int, struct sched_param *); 1984extern int sched_setscheduler(struct task_struct *, int,
1985 const struct sched_param *);
1952extern int sched_setscheduler_nocheck(struct task_struct *, int, 1986extern int sched_setscheduler_nocheck(struct task_struct *, int,
1953 struct sched_param *); 1987 const struct sched_param *);
1954extern struct task_struct *idle_task(int cpu); 1988extern struct task_struct *idle_task(int cpu);
1955extern struct task_struct *curr_task(int cpu); 1989extern struct task_struct *curr_task(int cpu);
1956extern void set_curr_task(int cpu, struct task_struct *p); 1990extern void set_curr_task(int cpu, struct task_struct *p);