Skip to content

Commit e1e9bdc

Browse files
irengepaulmckrcu
authored andcommitted
rcu: Add missing annotation for exit_tasks_rcu_start()
Sparse reports a warning at exit_tasks_rcu_start(void) |warning: context imbalance in exit_tasks_rcu_start() - wrong count at exit To fix this, this commit adds an __acquires(&tasks_rcu_exit_srcu). Given that exit_tasks_rcu_start() does actually call __srcu_read_lock(), this not only fixes the warning but also improves on the readability of the code. Signed-off-by: Jules Irenge <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Joel Fernandes (Google) <[email protected]>
1 parent fcb7381 commit e1e9bdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/update.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ static int __init rcu_spawn_tasks_kthread(void)
801801
core_initcall(rcu_spawn_tasks_kthread);
802802

803803
/* Do the srcu_read_lock() for the above synchronize_srcu(). */
804-
void exit_tasks_rcu_start(void)
804+
void exit_tasks_rcu_start(void) __acquires(&tasks_rcu_exit_srcu)
805805
{
806806
preempt_disable();
807807
current->rcu_tasks_idx = __srcu_read_lock(&tasks_rcu_exit_srcu);

0 commit comments

Comments
 (0)