Skip to content

Commit 4475709

Browse files
Frederic Weisbeckerpaulmckrcu
authored andcommitted
rcu-tasks: Remove preemption disablement around srcu_read_[un]lock() calls
Ever since the following commit: 5a41344 ("srcu: Simplify __srcu_read_unlock() via this_cpu_dec()") SRCU doesn't rely anymore on preemption to be disabled in order to modify the per-CPU counter. And even then it used to be done from the API itself. Therefore and after checking further, it appears to be safe to remove the preemption disablement around __srcu_read_[un]lock() in exit_tasks_rcu_start() and exit_tasks_rcu_finish() Suggested-by: Boqun Feng <[email protected]> Suggested-by: Paul E. McKenney <[email protected]> Suggested-by: Neeraj Upadhyay <[email protected]> Cc: Lai Jiangshan <[email protected]> Signed-off-by: Frederic Weisbecker <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent e4e1e80 commit 4475709

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

kernel/rcu/tasks.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,9 +1008,7 @@ EXPORT_SYMBOL_GPL(show_rcu_tasks_classic_gp_kthread);
10081008
*/
10091009
void exit_tasks_rcu_start(void) __acquires(&tasks_rcu_exit_srcu)
10101010
{
1011-
preempt_disable();
10121011
current->rcu_tasks_idx = __srcu_read_lock(&tasks_rcu_exit_srcu);
1013-
preempt_enable();
10141012
}
10151013

10161014
/*
@@ -1022,9 +1020,7 @@ void exit_tasks_rcu_finish(void) __releases(&tasks_rcu_exit_srcu)
10221020
{
10231021
struct task_struct *t = current;
10241022

1025-
preempt_disable();
10261023
__srcu_read_unlock(&tasks_rcu_exit_srcu, t->rcu_tasks_idx);
1027-
preempt_enable();
10281024
exit_tasks_rcu_finish_trace(t);
10291025
}
10301026

0 commit comments

Comments
 (0)