aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-13 09:44:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-13 09:44:12 -0400
commitd6dd50e07c5bec00db2005969b1a01f8ca3d25ef (patch)
tree53e36ac30a3d0fdca3834f4e1eb36ddc67b512ce /include/linux/sched.h
parent5ff0b9e1a1da58b584aa4b8ea234be20b5a1164b (diff)
parentfd19bda491207f66d39aeba93487197a087bc00b (diff)
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RCU updates from Ingo Molnar: "The main changes in this cycle were: - changes related to No-CBs CPUs and NO_HZ_FULL - RCU-tasks implementation - torture-test updates - miscellaneous fixes - locktorture updates - RCU documentation updates" * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (81 commits) workqueue: Use cond_resched_rcu_qs macro workqueue: Add quiescent state between work items locktorture: Cleanup header usage locktorture: Cannot hold read and write lock locktorture: Fix __acquire annotation for spinlock irq locktorture: Support rwlocks rcu: Eliminate deadlock between CPU hotplug and expedited grace periods locktorture: Document boot/module parameters rcutorture: Rename rcutorture_runnable parameter locktorture: Add test scenario for rwsem_lock locktorture: Add test scenario for mutex_lock locktorture: Make torture scripting account for new _runnable name locktorture: Introduce torture context locktorture: Support rwsems locktorture: Add infrastructure for torturing read locks torture: Address race in module cleanup locktorture: Make statistics generic locktorture: Teach about lock debugging locktorture: Support mutexes locktorture: Add documentation ...
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h39
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
1216union rcu_special {
1217 struct {
1218 bool blocked;
1219 bool need_qs;
1220 } b;
1221 short s;
1222};
1216struct rcu_node; 1223struct rcu_node;
1217 1224
1218enum perf_event_task_context { 1225enum 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);
2014extern void task_clear_jobctl_pending(struct task_struct *task, 2027extern 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
2022static inline void rcu_copy_process(struct task_struct *p) 2030static 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
2034static inline void rcu_copy_process(struct task_struct *p)
2035{
2036}
2037
2038#endif
2039
2040static inline void tsk_restore_flags(struct task_struct *task, 2045static 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{