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.h72
1 files changed, 46 insertions, 26 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 75e6e60bf583..5c858f38e81a 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -145,7 +145,6 @@ extern unsigned long this_cpu_load(void);
145 145
146 146
147extern void calc_global_load(void); 147extern void calc_global_load(void);
148extern u64 cpu_nr_migrations(int cpu);
149 148
150extern unsigned long get_parent_ip(unsigned long addr); 149extern unsigned long get_parent_ip(unsigned long addr);
151 150
@@ -171,8 +170,6 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
171} 170}
172#endif 171#endif
173 172
174extern unsigned long long time_sync_thresh;
175
176/* 173/*
177 * Task state bitmask. NOTE! These bits are also 174 * Task state bitmask. NOTE! These bits are also
178 * encoded in fs/proc/array.c: get_task_state(). 175 * encoded in fs/proc/array.c: get_task_state().
@@ -349,7 +346,6 @@ extern signed long schedule_timeout(signed long timeout);
349extern signed long schedule_timeout_interruptible(signed long timeout); 346extern signed long schedule_timeout_interruptible(signed long timeout);
350extern signed long schedule_timeout_killable(signed long timeout); 347extern signed long schedule_timeout_killable(signed long timeout);
351extern signed long schedule_timeout_uninterruptible(signed long timeout); 348extern signed long schedule_timeout_uninterruptible(signed long timeout);
352asmlinkage void __schedule(void);
353asmlinkage void schedule(void); 349asmlinkage void schedule(void);
354extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); 350extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner);
355 351
@@ -628,6 +624,9 @@ struct signal_struct {
628 cputime_t utime, stime, cutime, cstime; 624 cputime_t utime, stime, cutime, cstime;
629 cputime_t gtime; 625 cputime_t gtime;
630 cputime_t cgtime; 626 cputime_t cgtime;
627#ifndef CONFIG_VIRT_CPU_ACCOUNTING
628 cputime_t prev_utime, prev_stime;
629#endif
631 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 630 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
632 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; 631 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
633 unsigned long inblock, oublock, cinblock, coublock; 632 unsigned long inblock, oublock, cinblock, coublock;
@@ -1013,9 +1012,13 @@ static inline struct cpumask *sched_domain_span(struct sched_domain *sd)
1013 return to_cpumask(sd->span); 1012 return to_cpumask(sd->span);
1014} 1013}
1015 1014
1016extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new, 1015extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
1017 struct sched_domain_attr *dattr_new); 1016 struct sched_domain_attr *dattr_new);
1018 1017
1018/* Allocate an array of sched domains, for partition_sched_domains(). */
1019cpumask_var_t *alloc_sched_domains(unsigned int ndoms);
1020void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms);
1021
1019/* Test a flag in parent sched domain */ 1022/* Test a flag in parent sched domain */
1020static inline int test_sd_parent(struct sched_domain *sd, int flag) 1023static inline int test_sd_parent(struct sched_domain *sd, int flag)
1021{ 1024{
@@ -1033,7 +1036,7 @@ unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu);
1033struct sched_domain_attr; 1036struct sched_domain_attr;
1034 1037
1035static inline void 1038static inline void
1036partition_sched_domains(int ndoms_new, struct cpumask *doms_new, 1039partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
1037 struct sched_domain_attr *dattr_new) 1040 struct sched_domain_attr *dattr_new)
1038{ 1041{
1039} 1042}
@@ -1099,7 +1102,7 @@ struct sched_class {
1099 1102
1100 void (*set_curr_task) (struct rq *rq); 1103 void (*set_curr_task) (struct rq *rq);
1101 void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); 1104 void (*task_tick) (struct rq *rq, struct task_struct *p, int queued);
1102 void (*task_new) (struct rq *rq, struct task_struct *p); 1105 void (*task_fork) (struct task_struct *p);
1103 1106
1104 void (*switched_from) (struct rq *this_rq, struct task_struct *task, 1107 void (*switched_from) (struct rq *this_rq, struct task_struct *task,
1105 int running); 1108 int running);
@@ -1108,7 +1111,8 @@ struct sched_class {
1108 void (*prio_changed) (struct rq *this_rq, struct task_struct *task, 1111 void (*prio_changed) (struct rq *this_rq, struct task_struct *task,
1109 int oldprio, int running); 1112 int oldprio, int running);
1110 1113
1111 unsigned int (*get_rr_interval) (struct task_struct *task); 1114 unsigned int (*get_rr_interval) (struct rq *rq,
1115 struct task_struct *task);
1112 1116
1113#ifdef CONFIG_FAIR_GROUP_SCHED 1117#ifdef CONFIG_FAIR_GROUP_SCHED
1114 void (*moved_group) (struct task_struct *p); 1118 void (*moved_group) (struct task_struct *p);
@@ -1148,8 +1152,6 @@ struct sched_entity {
1148 u64 start_runtime; 1152 u64 start_runtime;
1149 u64 avg_wakeup; 1153 u64 avg_wakeup;
1150 1154
1151 u64 avg_running;
1152
1153#ifdef CONFIG_SCHEDSTATS 1155#ifdef CONFIG_SCHEDSTATS
1154 u64 wait_start; 1156 u64 wait_start;
1155 u64 wait_max; 1157 u64 wait_max;
@@ -1172,7 +1174,6 @@ struct sched_entity {
1172 u64 nr_failed_migrations_running; 1174 u64 nr_failed_migrations_running;
1173 u64 nr_failed_migrations_hot; 1175 u64 nr_failed_migrations_hot;
1174 u64 nr_forced_migrations; 1176 u64 nr_forced_migrations;
1175 u64 nr_forced2_migrations;
1176 1177
1177 u64 nr_wakeups; 1178 u64 nr_wakeups;
1178 u64 nr_wakeups_sync; 1179 u64 nr_wakeups_sync;
@@ -1331,7 +1332,9 @@ struct task_struct {
1331 1332
1332 cputime_t utime, stime, utimescaled, stimescaled; 1333 cputime_t utime, stime, utimescaled, stimescaled;
1333 cputime_t gtime; 1334 cputime_t gtime;
1335#ifndef CONFIG_VIRT_CPU_ACCOUNTING
1334 cputime_t prev_utime, prev_stime; 1336 cputime_t prev_utime, prev_stime;
1337#endif
1335 unsigned long nvcsw, nivcsw; /* context switch counts */ 1338 unsigned long nvcsw, nivcsw; /* context switch counts */
1336 struct timespec start_time; /* monotonic time */ 1339 struct timespec start_time; /* monotonic time */
1337 struct timespec real_start_time; /* boot based time */ 1340 struct timespec real_start_time; /* boot based time */
@@ -1406,7 +1409,7 @@ struct task_struct {
1406#endif 1409#endif
1407 1410
1408 /* Protection of the PI data structures: */ 1411 /* Protection of the PI data structures: */
1409 spinlock_t pi_lock; 1412 raw_spinlock_t pi_lock;
1410 1413
1411#ifdef CONFIG_RT_MUTEXES 1414#ifdef CONFIG_RT_MUTEXES
1412 /* PI waiters blocked on a rt_mutex held by this task */ 1415 /* PI waiters blocked on a rt_mutex held by this task */
@@ -1421,17 +1424,17 @@ struct task_struct {
1421#endif 1424#endif
1422#ifdef CONFIG_TRACE_IRQFLAGS 1425#ifdef CONFIG_TRACE_IRQFLAGS
1423 unsigned int irq_events; 1426 unsigned int irq_events;
1424 int hardirqs_enabled;
1425 unsigned long hardirq_enable_ip; 1427 unsigned long hardirq_enable_ip;
1426 unsigned int hardirq_enable_event;
1427 unsigned long hardirq_disable_ip; 1428 unsigned long hardirq_disable_ip;
1429 unsigned int hardirq_enable_event;
1428 unsigned int hardirq_disable_event; 1430 unsigned int hardirq_disable_event;
1429 int softirqs_enabled; 1431 int hardirqs_enabled;
1432 int hardirq_context;
1430 unsigned long softirq_disable_ip; 1433 unsigned long softirq_disable_ip;
1431 unsigned int softirq_disable_event;
1432 unsigned long softirq_enable_ip; 1434 unsigned long softirq_enable_ip;
1435 unsigned int softirq_disable_event;
1433 unsigned int softirq_enable_event; 1436 unsigned int softirq_enable_event;
1434 int hardirq_context; 1437 int softirqs_enabled;
1435 int softirq_context; 1438 int softirq_context;
1436#endif 1439#endif
1437#ifdef CONFIG_LOCKDEP 1440#ifdef CONFIG_LOCKDEP
@@ -1443,8 +1446,10 @@ struct task_struct {
1443 gfp_t lockdep_reclaim_gfp; 1446 gfp_t lockdep_reclaim_gfp;
1444#endif 1447#endif
1445 1448
1449#ifdef CONFIG_FS_JOURNAL_INFO
1446/* journalling filesystem info */ 1450/* journalling filesystem info */
1447 void *journal_info; 1451 void *journal_info;
1452#endif
1448 1453
1449/* stacked block device info */ 1454/* stacked block device info */
1450 struct bio *bio_list, **bio_tail; 1455 struct bio *bio_list, **bio_tail;
@@ -1720,9 +1725,8 @@ static inline void put_task_struct(struct task_struct *t)
1720 __put_task_struct(t); 1725 __put_task_struct(t);
1721} 1726}
1722 1727
1723extern cputime_t task_utime(struct task_struct *p); 1728extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st);
1724extern cputime_t task_stime(struct task_struct *p); 1729extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st);
1725extern cputime_t task_gtime(struct task_struct *p);
1726 1730
1727/* 1731/*
1728 * Per process flags 1732 * Per process flags
@@ -1836,7 +1840,8 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1836extern int sched_clock_stable; 1840extern int sched_clock_stable;
1837#endif 1841#endif
1838 1842
1839extern unsigned long long sched_clock(void); 1843/* ftrace calls sched_clock() directly */
1844extern unsigned long long notrace sched_clock(void);
1840 1845
1841extern void sched_clock_init(void); 1846extern void sched_clock_init(void);
1842extern u64 sched_clock_cpu(int cpu); 1847extern u64 sched_clock_cpu(int cpu);
@@ -1899,14 +1904,22 @@ extern unsigned int sysctl_sched_wakeup_granularity;
1899extern unsigned int sysctl_sched_shares_ratelimit; 1904extern unsigned int sysctl_sched_shares_ratelimit;
1900extern unsigned int sysctl_sched_shares_thresh; 1905extern unsigned int sysctl_sched_shares_thresh;
1901extern unsigned int sysctl_sched_child_runs_first; 1906extern unsigned int sysctl_sched_child_runs_first;
1907
1908enum sched_tunable_scaling {
1909 SCHED_TUNABLESCALING_NONE,
1910 SCHED_TUNABLESCALING_LOG,
1911 SCHED_TUNABLESCALING_LINEAR,
1912 SCHED_TUNABLESCALING_END,
1913};
1914extern enum sched_tunable_scaling sysctl_sched_tunable_scaling;
1915
1902#ifdef CONFIG_SCHED_DEBUG 1916#ifdef CONFIG_SCHED_DEBUG
1903extern unsigned int sysctl_sched_features;
1904extern unsigned int sysctl_sched_migration_cost; 1917extern unsigned int sysctl_sched_migration_cost;
1905extern unsigned int sysctl_sched_nr_migrate; 1918extern unsigned int sysctl_sched_nr_migrate;
1906extern unsigned int sysctl_sched_time_avg; 1919extern unsigned int sysctl_sched_time_avg;
1907extern unsigned int sysctl_timer_migration; 1920extern unsigned int sysctl_timer_migration;
1908 1921
1909int sched_nr_latency_handler(struct ctl_table *table, int write, 1922int sched_proc_update_handler(struct ctl_table *table, int write,
1910 void __user *buffer, size_t *length, 1923 void __user *buffer, size_t *length,
1911 loff_t *ppos); 1924 loff_t *ppos);
1912#endif 1925#endif
@@ -2086,11 +2099,18 @@ static inline int is_si_special(const struct siginfo *info)
2086 return info <= SEND_SIG_FORCED; 2099 return info <= SEND_SIG_FORCED;
2087} 2100}
2088 2101
2089/* True if we are on the alternate signal stack. */ 2102/*
2090 2103 * True if we are on the alternate signal stack.
2104 */
2091static inline int on_sig_stack(unsigned long sp) 2105static inline int on_sig_stack(unsigned long sp)
2092{ 2106{
2093 return (sp - current->sas_ss_sp < current->sas_ss_size); 2107#ifdef CONFIG_STACK_GROWSUP
2108 return sp >= current->sas_ss_sp &&
2109 sp - current->sas_ss_sp < current->sas_ss_size;
2110#else
2111 return sp > current->sas_ss_sp &&
2112 sp - current->sas_ss_sp <= current->sas_ss_size;
2113#endif
2094} 2114}
2095 2115
2096static inline int sas_ss_flags(unsigned long sp) 2116static inline int sas_ss_flags(unsigned long sp)