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.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4896fdfec91..02042e7f219 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -261,6 +261,7 @@ extern void task_rq_unlock_wait(struct task_struct *p);
261extern cpumask_var_t nohz_cpu_mask; 261extern cpumask_var_t nohz_cpu_mask;
262#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 262#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
263extern int select_nohz_load_balancer(int cpu); 263extern int select_nohz_load_balancer(int cpu);
264extern int get_nohz_load_balancer(void);
264#else 265#else
265static inline int select_nohz_load_balancer(int cpu) 266static inline int select_nohz_load_balancer(int cpu)
266{ 267{
@@ -673,7 +674,7 @@ struct user_struct {
673 struct task_group *tg; 674 struct task_group *tg;
674#ifdef CONFIG_SYSFS 675#ifdef CONFIG_SYSFS
675 struct kobject kobj; 676 struct kobject kobj;
676 struct work_struct work; 677 struct delayed_work work;
677#endif 678#endif
678#endif 679#endif
679 680
@@ -1177,7 +1178,6 @@ struct task_struct {
1177 * a short time 1178 * a short time
1178 */ 1179 */
1179 unsigned char fpu_counter; 1180 unsigned char fpu_counter;
1180 s8 oomkilladj; /* OOM kill score adjustment (bit shift). */
1181#ifdef CONFIG_BLK_DEV_IO_TRACE 1181#ifdef CONFIG_BLK_DEV_IO_TRACE
1182 unsigned int btrace_seq; 1182 unsigned int btrace_seq;
1183#endif 1183#endif
@@ -1317,7 +1317,8 @@ struct task_struct {
1317/* Thread group tracking */ 1317/* Thread group tracking */
1318 u32 parent_exec_id; 1318 u32 parent_exec_id;
1319 u32 self_exec_id; 1319 u32 self_exec_id;
1320/* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ 1320/* Protection of (de-)allocation: mm, files, fs, tty, keyrings, mems_allowed,
1321 * mempolicy */
1321 spinlock_t alloc_lock; 1322 spinlock_t alloc_lock;
1322 1323
1323#ifdef CONFIG_GENERIC_HARDIRQS 1324#ifdef CONFIG_GENERIC_HARDIRQS
@@ -1385,8 +1386,7 @@ struct task_struct {
1385 cputime_t acct_timexpd; /* stime + utime since last update */ 1386 cputime_t acct_timexpd; /* stime + utime since last update */
1386#endif 1387#endif
1387#ifdef CONFIG_CPUSETS 1388#ifdef CONFIG_CPUSETS
1388 nodemask_t mems_allowed; 1389 nodemask_t mems_allowed; /* Protected by alloc_lock */
1389 int cpuset_mems_generation;
1390 int cpuset_mem_spread_rotor; 1390 int cpuset_mem_spread_rotor;
1391#endif 1391#endif
1392#ifdef CONFIG_CGROUPS 1392#ifdef CONFIG_CGROUPS
@@ -1409,7 +1409,7 @@ struct task_struct {
1409 struct list_head perf_counter_list; 1409 struct list_head perf_counter_list;
1410#endif 1410#endif
1411#ifdef CONFIG_NUMA 1411#ifdef CONFIG_NUMA
1412 struct mempolicy *mempolicy; 1412 struct mempolicy *mempolicy; /* Protected by alloc_lock */
1413 short il_next; 1413 short il_next;
1414#endif 1414#endif
1415 atomic_t fs_excl; /* holding fs exclusive resources */ 1415 atomic_t fs_excl; /* holding fs exclusive resources */
@@ -1796,11 +1796,23 @@ extern unsigned int sysctl_sched_child_runs_first;
1796extern unsigned int sysctl_sched_features; 1796extern unsigned int sysctl_sched_features;
1797extern unsigned int sysctl_sched_migration_cost; 1797extern unsigned int sysctl_sched_migration_cost;
1798extern unsigned int sysctl_sched_nr_migrate; 1798extern unsigned int sysctl_sched_nr_migrate;
1799extern unsigned int sysctl_timer_migration;
1799 1800
1800int sched_nr_latency_handler(struct ctl_table *table, int write, 1801int sched_nr_latency_handler(struct ctl_table *table, int write,
1801 struct file *file, void __user *buffer, size_t *length, 1802 struct file *file, void __user *buffer, size_t *length,
1802 loff_t *ppos); 1803 loff_t *ppos);
1803#endif 1804#endif
1805#ifdef CONFIG_SCHED_DEBUG
1806static inline unsigned int get_sysctl_timer_migration(void)
1807{
1808 return sysctl_timer_migration;
1809}
1810#else
1811static inline unsigned int get_sysctl_timer_migration(void)
1812{
1813 return 1;
1814}
1815#endif
1804extern unsigned int sysctl_sched_rt_period; 1816extern unsigned int sysctl_sched_rt_period;
1805extern int sysctl_sched_rt_runtime; 1817extern int sysctl_sched_rt_runtime;
1806 1818
@@ -2212,6 +2224,12 @@ static inline int test_tsk_need_resched(struct task_struct *tsk)
2212 return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); 2224 return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED));
2213} 2225}
2214 2226
2227static inline int restart_syscall(void)
2228{
2229 set_tsk_thread_flag(current, TIF_SIGPENDING);
2230 return -ERESTARTNOINTR;
2231}
2232
2215static inline int signal_pending(struct task_struct *p) 2233static inline int signal_pending(struct task_struct *p)
2216{ 2234{
2217 return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); 2235 return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING));