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.h51
1 files changed, 39 insertions, 12 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 1e2a6db2d7dd..56154bbb8da9 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -336,6 +336,9 @@ extern unsigned long sysctl_hung_task_warnings;
336extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, 336extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,
337 void __user *buffer, 337 void __user *buffer,
338 size_t *lenp, loff_t *ppos); 338 size_t *lenp, loff_t *ppos);
339#else
340/* Avoid need for ifdefs elsewhere in the code */
341enum { sysctl_hung_task_timeout_secs = 0 };
339#endif 342#endif
340 343
341/* Attach to any functions which should be ignored in wchan output. */ 344/* Attach to any functions which should be ignored in wchan output. */
@@ -875,6 +878,7 @@ enum sched_domain_level {
875 SD_LV_NONE = 0, 878 SD_LV_NONE = 0,
876 SD_LV_SIBLING, 879 SD_LV_SIBLING,
877 SD_LV_MC, 880 SD_LV_MC,
881 SD_LV_BOOK,
878 SD_LV_CPU, 882 SD_LV_CPU,
879 SD_LV_NODE, 883 SD_LV_NODE,
880 SD_LV_ALLNODES, 884 SD_LV_ALLNODES,
@@ -1160,6 +1164,13 @@ struct sched_rt_entity {
1160 1164
1161struct rcu_node; 1165struct rcu_node;
1162 1166
1167enum perf_event_task_context {
1168 perf_invalid_context = -1,
1169 perf_hw_context = 0,
1170 perf_sw_context,
1171 perf_nr_task_contexts,
1172};
1173
1163struct task_struct { 1174struct task_struct {
1164 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ 1175 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
1165 void *stack; 1176 void *stack;
@@ -1202,11 +1213,13 @@ struct task_struct {
1202 unsigned int policy; 1213 unsigned int policy;
1203 cpumask_t cpus_allowed; 1214 cpumask_t cpus_allowed;
1204 1215
1205#ifdef CONFIG_TREE_PREEMPT_RCU 1216#ifdef CONFIG_PREEMPT_RCU
1206 int rcu_read_lock_nesting; 1217 int rcu_read_lock_nesting;
1207 char rcu_read_unlock_special; 1218 char rcu_read_unlock_special;
1208 struct rcu_node *rcu_blocked_node;
1209 struct list_head rcu_node_entry; 1219 struct list_head rcu_node_entry;
1220#endif /* #ifdef CONFIG_PREEMPT_RCU */
1221#ifdef CONFIG_TREE_PREEMPT_RCU
1222 struct rcu_node *rcu_blocked_node;
1210#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 1223#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
1211 1224
1212#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) 1225#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
@@ -1288,9 +1301,9 @@ struct task_struct {
1288 struct list_head cpu_timers[3]; 1301 struct list_head cpu_timers[3];
1289 1302
1290/* process credentials */ 1303/* process credentials */
1291 const struct cred *real_cred; /* objective and real subjective task 1304 const struct cred __rcu *real_cred; /* objective and real subjective task
1292 * credentials (COW) */ 1305 * credentials (COW) */
1293 const struct cred *cred; /* effective (overridable) subjective task 1306 const struct cred __rcu *cred; /* effective (overridable) subjective task
1294 * credentials (COW) */ 1307 * credentials (COW) */
1295 struct mutex cred_guard_mutex; /* guard against foreign influences on 1308 struct mutex cred_guard_mutex; /* guard against foreign influences on
1296 * credential calculations 1309 * credential calculations
@@ -1418,7 +1431,7 @@ struct task_struct {
1418#endif 1431#endif
1419#ifdef CONFIG_CGROUPS 1432#ifdef CONFIG_CGROUPS
1420 /* Control Group info protected by css_set_lock */ 1433 /* Control Group info protected by css_set_lock */
1421 struct css_set *cgroups; 1434 struct css_set __rcu *cgroups;
1422 /* cg_list protected by css_set_lock and tsk->alloc_lock */ 1435 /* cg_list protected by css_set_lock and tsk->alloc_lock */
1423 struct list_head cg_list; 1436 struct list_head cg_list;
1424#endif 1437#endif
@@ -1431,7 +1444,7 @@ struct task_struct {
1431 struct futex_pi_state *pi_state_cache; 1444 struct futex_pi_state *pi_state_cache;
1432#endif 1445#endif
1433#ifdef CONFIG_PERF_EVENTS 1446#ifdef CONFIG_PERF_EVENTS
1434 struct perf_event_context *perf_event_ctxp; 1447 struct perf_event_context *perf_event_ctxp[perf_nr_task_contexts];
1435 struct mutex perf_event_mutex; 1448 struct mutex perf_event_mutex;
1436 struct list_head perf_event_list; 1449 struct list_head perf_event_list;
1437#endif 1450#endif
@@ -1681,8 +1694,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1681/* 1694/*
1682 * Per process flags 1695 * Per process flags
1683 */ 1696 */
1684#define PF_ALIGNWARN 0x00000001 /* Print alignment warning msgs */ 1697#define PF_KSOFTIRQD 0x00000001 /* I am ksoftirqd */
1685 /* Not implemented yet, only for 486*/
1686#define PF_STARTING 0x00000002 /* being created */ 1698#define PF_STARTING 0x00000002 /* being created */
1687#define PF_EXITING 0x00000004 /* getting shut down */ 1699#define PF_EXITING 0x00000004 /* getting shut down */
1688#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ 1700#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */
@@ -1740,7 +1752,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1740#define tsk_used_math(p) ((p)->flags & PF_USED_MATH) 1752#define tsk_used_math(p) ((p)->flags & PF_USED_MATH)
1741#define used_math() tsk_used_math(current) 1753#define used_math() tsk_used_math(current)
1742 1754
1743#ifdef CONFIG_TREE_PREEMPT_RCU 1755#ifdef CONFIG_PREEMPT_RCU
1744 1756
1745#define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ 1757#define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */
1746#define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */ 1758#define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */
@@ -1749,7 +1761,9 @@ static inline void rcu_copy_process(struct task_struct *p)
1749{ 1761{
1750 p->rcu_read_lock_nesting = 0; 1762 p->rcu_read_lock_nesting = 0;
1751 p->rcu_read_unlock_special = 0; 1763 p->rcu_read_unlock_special = 0;
1764#ifdef CONFIG_TREE_PREEMPT_RCU
1752 p->rcu_blocked_node = NULL; 1765 p->rcu_blocked_node = NULL;
1766#endif
1753 INIT_LIST_HEAD(&p->rcu_node_entry); 1767 INIT_LIST_HEAD(&p->rcu_node_entry);
1754} 1768}
1755 1769
@@ -1826,6 +1840,19 @@ extern void sched_clock_idle_sleep_event(void);
1826extern void sched_clock_idle_wakeup_event(u64 delta_ns); 1840extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1827#endif 1841#endif
1828 1842
1843#ifdef CONFIG_IRQ_TIME_ACCOUNTING
1844/*
1845 * An i/f to runtime opt-in for irq time accounting based off of sched_clock.
1846 * The reason for this explicit opt-in is not to have perf penalty with
1847 * slow sched_clocks.
1848 */
1849extern void enable_sched_clock_irqtime(void);
1850extern void disable_sched_clock_irqtime(void);
1851#else
1852static inline void enable_sched_clock_irqtime(void) {}
1853static inline void disable_sched_clock_irqtime(void) {}
1854#endif
1855
1829extern unsigned long long 1856extern unsigned long long
1830task_sched_runtime(struct task_struct *task); 1857task_sched_runtime(struct task_struct *task);
1831extern unsigned long long thread_group_sched_runtime(struct task_struct *task); 1858extern unsigned long long thread_group_sched_runtime(struct task_struct *task);
@@ -2367,9 +2394,9 @@ extern int __cond_resched_lock(spinlock_t *lock);
2367 2394
2368extern int __cond_resched_softirq(void); 2395extern int __cond_resched_softirq(void);
2369 2396
2370#define cond_resched_softirq() ({ \ 2397#define cond_resched_softirq() ({ \
2371 __might_sleep(__FILE__, __LINE__, SOFTIRQ_OFFSET); \ 2398 __might_sleep(__FILE__, __LINE__, SOFTIRQ_DISABLE_OFFSET); \
2372 __cond_resched_softirq(); \ 2399 __cond_resched_softirq(); \
2373}) 2400})
2374 2401
2375/* 2402/*