aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/update.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rcu/update.c')
-rw-r--r--kernel/rcu/update.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index 00e77c470017..5033b66d2753 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -568,7 +568,7 @@ static DECLARE_WAIT_QUEUE_HEAD(rcu_tasks_cbs_wq);
568static DEFINE_RAW_SPINLOCK(rcu_tasks_cbs_lock); 568static DEFINE_RAW_SPINLOCK(rcu_tasks_cbs_lock);
569 569
570/* Track exiting tasks in order to allow them to be waited for. */ 570/* Track exiting tasks in order to allow them to be waited for. */
571DEFINE_SRCU(tasks_rcu_exit_srcu); 571DEFINE_STATIC_SRCU(tasks_rcu_exit_srcu);
572 572
573/* Control stall timeouts. Disable with <= 0, otherwise jiffies till stall. */ 573/* Control stall timeouts. Disable with <= 0, otherwise jiffies till stall. */
574#define RCU_TASK_STALL_TIMEOUT (HZ * 60 * 10) 574#define RCU_TASK_STALL_TIMEOUT (HZ * 60 * 10)
@@ -875,6 +875,22 @@ static void rcu_spawn_tasks_kthread(void)
875 mutex_unlock(&rcu_tasks_kthread_mutex); 875 mutex_unlock(&rcu_tasks_kthread_mutex);
876} 876}
877 877
878/* Do the srcu_read_lock() for the above synchronize_srcu(). */
879void exit_tasks_rcu_start(void)
880{
881 preempt_disable();
882 current->rcu_tasks_idx = __srcu_read_lock(&tasks_rcu_exit_srcu);
883 preempt_enable();
884}
885
886/* Do the srcu_read_unlock() for the above synchronize_srcu(). */
887void exit_tasks_rcu_finish(void)
888{
889 preempt_disable();
890 __srcu_read_unlock(&tasks_rcu_exit_srcu, current->rcu_tasks_idx);
891 preempt_enable();
892}
893
878#endif /* #ifdef CONFIG_TASKS_RCU */ 894#endif /* #ifdef CONFIG_TASKS_RCU */
879 895
880#ifndef CONFIG_TINY_RCU 896#ifndef CONFIG_TINY_RCU