diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5e63ba59258c..05a8c00e8339 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1213,6 +1213,13 @@ struct sched_dl_entity { | |||
1213 | struct hrtimer dl_timer; | 1213 | struct hrtimer dl_timer; |
1214 | }; | 1214 | }; |
1215 | 1215 | ||
1216 | union rcu_special { | ||
1217 | struct { | ||
1218 | bool blocked; | ||
1219 | bool need_qs; | ||
1220 | } b; | ||
1221 | short s; | ||
1222 | }; | ||
1216 | struct rcu_node; | 1223 | struct rcu_node; |
1217 | 1224 | ||
1218 | enum perf_event_task_context { | 1225 | enum perf_event_task_context { |
@@ -1265,12 +1272,18 @@ struct task_struct { | |||
1265 | 1272 | ||
1266 | #ifdef CONFIG_PREEMPT_RCU | 1273 | #ifdef CONFIG_PREEMPT_RCU |
1267 | int rcu_read_lock_nesting; | 1274 | int rcu_read_lock_nesting; |
1268 | char rcu_read_unlock_special; | 1275 | union rcu_special rcu_read_unlock_special; |
1269 | struct list_head rcu_node_entry; | 1276 | struct list_head rcu_node_entry; |
1270 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ | 1277 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ |
1271 | #ifdef CONFIG_TREE_PREEMPT_RCU | 1278 | #ifdef CONFIG_TREE_PREEMPT_RCU |
1272 | struct rcu_node *rcu_blocked_node; | 1279 | struct rcu_node *rcu_blocked_node; |
1273 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 1280 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
1281 | #ifdef CONFIG_TASKS_RCU | ||
1282 | unsigned long rcu_tasks_nvcsw; | ||
1283 | bool rcu_tasks_holdout; | ||
1284 | struct list_head rcu_tasks_holdout_list; | ||
1285 | int rcu_tasks_idle_cpu; | ||
1286 | #endif /* #ifdef CONFIG_TASKS_RCU */ | ||
1274 | 1287 | ||
1275 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) | 1288 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
1276 | struct sched_info sched_info; | 1289 | struct sched_info sched_info; |
@@ -2014,29 +2027,21 @@ extern void task_clear_jobctl_trapping(struct task_struct *task); | |||
2014 | extern void task_clear_jobctl_pending(struct task_struct *task, | 2027 | extern void task_clear_jobctl_pending(struct task_struct *task, |
2015 | unsigned int mask); | 2028 | unsigned int mask); |
2016 | 2029 | ||
2017 | #ifdef CONFIG_PREEMPT_RCU | ||
2018 | |||
2019 | #define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ | ||
2020 | #define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */ | ||
2021 | |||
2022 | static inline void rcu_copy_process(struct task_struct *p) | 2030 | static inline void rcu_copy_process(struct task_struct *p) |
2023 | { | 2031 | { |
2032 | #ifdef CONFIG_PREEMPT_RCU | ||
2024 | p->rcu_read_lock_nesting = 0; | 2033 | p->rcu_read_lock_nesting = 0; |
2025 | p->rcu_read_unlock_special = 0; | 2034 | p->rcu_read_unlock_special.s = 0; |
2026 | #ifdef CONFIG_TREE_PREEMPT_RCU | ||
2027 | p->rcu_blocked_node = NULL; | 2035 | p->rcu_blocked_node = NULL; |
2028 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
2029 | INIT_LIST_HEAD(&p->rcu_node_entry); | 2036 | INIT_LIST_HEAD(&p->rcu_node_entry); |
2037 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ | ||
2038 | #ifdef CONFIG_TASKS_RCU | ||
2039 | p->rcu_tasks_holdout = false; | ||
2040 | INIT_LIST_HEAD(&p->rcu_tasks_holdout_list); | ||
2041 | p->rcu_tasks_idle_cpu = -1; | ||
2042 | #endif /* #ifdef CONFIG_TASKS_RCU */ | ||
2030 | } | 2043 | } |
2031 | 2044 | ||
2032 | #else | ||
2033 | |||
2034 | static inline void rcu_copy_process(struct task_struct *p) | ||
2035 | { | ||
2036 | } | ||
2037 | |||
2038 | #endif | ||
2039 | |||
2040 | static inline void tsk_restore_flags(struct task_struct *task, | 2045 | static inline void tsk_restore_flags(struct task_struct *task, |
2041 | unsigned long orig_flags, unsigned long flags) | 2046 | unsigned long orig_flags, unsigned long flags) |
2042 | { | 2047 | { |