diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/completion.h | 8 | ||||
-rw-r--r-- | include/linux/init_task.h | 9 | ||||
-rw-r--r-- | include/linux/mutex.h | 4 | ||||
-rw-r--r-- | include/linux/sched.h | 36 |
4 files changed, 45 insertions, 12 deletions
diff --git a/include/linux/completion.h b/include/linux/completion.h index 36d57f74cd01..51494e6b5548 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -81,10 +81,10 @@ extern int wait_for_completion_interruptible(struct completion *x); | |||
81 | extern int wait_for_completion_killable(struct completion *x); | 81 | extern int wait_for_completion_killable(struct completion *x); |
82 | extern unsigned long wait_for_completion_timeout(struct completion *x, | 82 | extern unsigned long wait_for_completion_timeout(struct completion *x, |
83 | unsigned long timeout); | 83 | unsigned long timeout); |
84 | extern unsigned long wait_for_completion_interruptible_timeout( | 84 | extern long wait_for_completion_interruptible_timeout( |
85 | struct completion *x, unsigned long timeout); | 85 | struct completion *x, unsigned long timeout); |
86 | extern unsigned long wait_for_completion_killable_timeout( | 86 | extern long wait_for_completion_killable_timeout( |
87 | struct completion *x, unsigned long timeout); | 87 | struct completion *x, unsigned long timeout); |
88 | extern bool try_wait_for_completion(struct completion *x); | 88 | extern bool try_wait_for_completion(struct completion *x); |
89 | extern bool completion_done(struct completion *x); | 89 | extern bool completion_done(struct completion *x); |
90 | 90 | ||
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 6b281fae114a..caa151fbebb7 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -12,6 +12,13 @@ | |||
12 | #include <linux/securebits.h> | 12 | #include <linux/securebits.h> |
13 | #include <net/net_namespace.h> | 13 | #include <net/net_namespace.h> |
14 | 14 | ||
15 | #ifdef CONFIG_SMP | ||
16 | # define INIT_PUSHABLE_TASKS(tsk) \ | ||
17 | .pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO), | ||
18 | #else | ||
19 | # define INIT_PUSHABLE_TASKS(tsk) | ||
20 | #endif | ||
21 | |||
15 | extern struct files_struct init_files; | 22 | extern struct files_struct init_files; |
16 | extern struct fs_struct init_fs; | 23 | extern struct fs_struct init_fs; |
17 | 24 | ||
@@ -144,7 +151,7 @@ extern struct cred init_cred; | |||
144 | .nr_cpus_allowed = NR_CPUS, \ | 151 | .nr_cpus_allowed = NR_CPUS, \ |
145 | }, \ | 152 | }, \ |
146 | .tasks = LIST_HEAD_INIT(tsk.tasks), \ | 153 | .tasks = LIST_HEAD_INIT(tsk.tasks), \ |
147 | .pushable_tasks = PLIST_NODE_INIT(tsk.pushable_tasks, MAX_PRIO), \ | 154 | INIT_PUSHABLE_TASKS(tsk) \ |
148 | .ptraced = LIST_HEAD_INIT(tsk.ptraced), \ | 155 | .ptraced = LIST_HEAD_INIT(tsk.ptraced), \ |
149 | .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ | 156 | .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \ |
150 | .real_parent = &tsk, \ | 157 | .real_parent = &tsk, \ |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index f363bc8fdc74..94b48bd40dd7 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -160,4 +160,8 @@ extern int mutex_trylock(struct mutex *lock); | |||
160 | extern void mutex_unlock(struct mutex *lock); | 160 | extern void mutex_unlock(struct mutex *lock); |
161 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); | 161 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); |
162 | 162 | ||
163 | #ifndef CONFIG_HAVE_ARCH_MUTEX_CPU_RELAX | ||
164 | #define arch_mutex_cpu_relax() cpu_relax() | ||
165 | #endif | ||
166 | |||
163 | #endif | 167 | #endif |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 48c409c279d3..777cd01e240e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -513,6 +513,8 @@ struct thread_group_cputimer { | |||
513 | spinlock_t lock; | 513 | spinlock_t lock; |
514 | }; | 514 | }; |
515 | 515 | ||
516 | struct autogroup; | ||
517 | |||
516 | /* | 518 | /* |
517 | * NOTE! "signal_struct" does not have it's own | 519 | * NOTE! "signal_struct" does not have it's own |
518 | * locking, because a shared signal_struct always | 520 | * locking, because a shared signal_struct always |
@@ -580,6 +582,9 @@ struct signal_struct { | |||
580 | 582 | ||
581 | struct tty_struct *tty; /* NULL if no tty */ | 583 | struct tty_struct *tty; /* NULL if no tty */ |
582 | 584 | ||
585 | #ifdef CONFIG_SCHED_AUTOGROUP | ||
586 | struct autogroup *autogroup; | ||
587 | #endif | ||
583 | /* | 588 | /* |
584 | * Cumulative resource counters for dead threads in the group, | 589 | * Cumulative resource counters for dead threads in the group, |
585 | * and for reaped dead child processes forked by this group. | 590 | * and for reaped dead child processes forked by this group. |
@@ -1242,7 +1247,9 @@ struct task_struct { | |||
1242 | #endif | 1247 | #endif |
1243 | 1248 | ||
1244 | struct list_head tasks; | 1249 | struct list_head tasks; |
1250 | #ifdef CONFIG_SMP | ||
1245 | struct plist_node pushable_tasks; | 1251 | struct plist_node pushable_tasks; |
1252 | #endif | ||
1246 | 1253 | ||
1247 | struct mm_struct *mm, *active_mm; | 1254 | struct mm_struct *mm, *active_mm; |
1248 | #if defined(SPLIT_RSS_COUNTING) | 1255 | #if defined(SPLIT_RSS_COUNTING) |
@@ -1883,14 +1890,11 @@ extern void sched_clock_idle_sleep_event(void); | |||
1883 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); | 1890 | extern void sched_clock_idle_wakeup_event(u64 delta_ns); |
1884 | 1891 | ||
1885 | #ifdef CONFIG_HOTPLUG_CPU | 1892 | #ifdef CONFIG_HOTPLUG_CPU |
1886 | extern void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p); | ||
1887 | extern void idle_task_exit(void); | 1893 | extern void idle_task_exit(void); |
1888 | #else | 1894 | #else |
1889 | static inline void idle_task_exit(void) {} | 1895 | static inline void idle_task_exit(void) {} |
1890 | #endif | 1896 | #endif |
1891 | 1897 | ||
1892 | extern void sched_idle_next(void); | ||
1893 | |||
1894 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) | 1898 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) |
1895 | extern void wake_up_idle_cpu(int cpu); | 1899 | extern void wake_up_idle_cpu(int cpu); |
1896 | #else | 1900 | #else |
@@ -1900,8 +1904,6 @@ static inline void wake_up_idle_cpu(int cpu) { } | |||
1900 | extern unsigned int sysctl_sched_latency; | 1904 | extern unsigned int sysctl_sched_latency; |
1901 | extern unsigned int sysctl_sched_min_granularity; | 1905 | extern unsigned int sysctl_sched_min_granularity; |
1902 | extern unsigned int sysctl_sched_wakeup_granularity; | 1906 | extern unsigned int sysctl_sched_wakeup_granularity; |
1903 | extern unsigned int sysctl_sched_shares_ratelimit; | ||
1904 | extern unsigned int sysctl_sched_shares_thresh; | ||
1905 | extern unsigned int sysctl_sched_child_runs_first; | 1907 | extern unsigned int sysctl_sched_child_runs_first; |
1906 | 1908 | ||
1907 | enum sched_tunable_scaling { | 1909 | enum sched_tunable_scaling { |
@@ -1917,6 +1919,7 @@ extern unsigned int sysctl_sched_migration_cost; | |||
1917 | extern unsigned int sysctl_sched_nr_migrate; | 1919 | extern unsigned int sysctl_sched_nr_migrate; |
1918 | extern unsigned int sysctl_sched_time_avg; | 1920 | extern unsigned int sysctl_sched_time_avg; |
1919 | extern unsigned int sysctl_timer_migration; | 1921 | extern unsigned int sysctl_timer_migration; |
1922 | extern unsigned int sysctl_sched_shares_window; | ||
1920 | 1923 | ||
1921 | int sched_proc_update_handler(struct ctl_table *table, int write, | 1924 | int sched_proc_update_handler(struct ctl_table *table, int write, |
1922 | void __user *buffer, size_t *length, | 1925 | void __user *buffer, size_t *length, |
@@ -1942,6 +1945,24 @@ int sched_rt_handler(struct ctl_table *table, int write, | |||
1942 | 1945 | ||
1943 | extern unsigned int sysctl_sched_compat_yield; | 1946 | extern unsigned int sysctl_sched_compat_yield; |
1944 | 1947 | ||
1948 | #ifdef CONFIG_SCHED_AUTOGROUP | ||
1949 | extern unsigned int sysctl_sched_autogroup_enabled; | ||
1950 | |||
1951 | extern void sched_autogroup_create_attach(struct task_struct *p); | ||
1952 | extern void sched_autogroup_detach(struct task_struct *p); | ||
1953 | extern void sched_autogroup_fork(struct signal_struct *sig); | ||
1954 | extern void sched_autogroup_exit(struct signal_struct *sig); | ||
1955 | #ifdef CONFIG_PROC_FS | ||
1956 | extern void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m); | ||
1957 | extern int proc_sched_autogroup_set_nice(struct task_struct *p, int *nice); | ||
1958 | #endif | ||
1959 | #else | ||
1960 | static inline void sched_autogroup_create_attach(struct task_struct *p) { } | ||
1961 | static inline void sched_autogroup_detach(struct task_struct *p) { } | ||
1962 | static inline void sched_autogroup_fork(struct signal_struct *sig) { } | ||
1963 | static inline void sched_autogroup_exit(struct signal_struct *sig) { } | ||
1964 | #endif | ||
1965 | |||
1945 | #ifdef CONFIG_RT_MUTEXES | 1966 | #ifdef CONFIG_RT_MUTEXES |
1946 | extern int rt_mutex_getprio(struct task_struct *p); | 1967 | extern int rt_mutex_getprio(struct task_struct *p); |
1947 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | 1968 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
@@ -1960,9 +1981,10 @@ extern int task_nice(const struct task_struct *p); | |||
1960 | extern int can_nice(const struct task_struct *p, const int nice); | 1981 | extern int can_nice(const struct task_struct *p, const int nice); |
1961 | extern int task_curr(const struct task_struct *p); | 1982 | extern int task_curr(const struct task_struct *p); |
1962 | extern int idle_cpu(int cpu); | 1983 | extern int idle_cpu(int cpu); |
1963 | extern int sched_setscheduler(struct task_struct *, int, struct sched_param *); | 1984 | extern int sched_setscheduler(struct task_struct *, int, |
1985 | const struct sched_param *); | ||
1964 | extern int sched_setscheduler_nocheck(struct task_struct *, int, | 1986 | extern int sched_setscheduler_nocheck(struct task_struct *, int, |
1965 | struct sched_param *); | 1987 | const struct sched_param *); |
1966 | extern struct task_struct *idle_task(int cpu); | 1988 | extern struct task_struct *idle_task(int cpu); |
1967 | extern struct task_struct *curr_task(int cpu); | 1989 | extern struct task_struct *curr_task(int cpu); |
1968 | extern void set_curr_task(int cpu, struct task_struct *p); | 1990 | extern void set_curr_task(int cpu, struct task_struct *p); |