Skip to content

Commit

Permalink
srcu: Add might_sleep() annotation to synchronize_srcu()
Browse files Browse the repository at this point in the history
Although synchronize_srcu() can sleep, it will not sleep if the fast
path succeeds, which means that illegal use of synchronize_rcu()
might go unnoticed.  This commit therefore adds might_sleep(), which
unconditionally catches illegal use of synchronize_rcu() from atomic
context.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  • Loading branch information
Lai Jiangshan authored and Paul E. McKenney committed Feb 7, 2013
1 parent 5a41344 commit 6e6f1b3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/srcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ static void __synchronize_srcu(struct srcu_struct *sp, int trycount)
!lock_is_held(&rcu_sched_lock_map),
"Illegal synchronize_srcu() in same-type SRCU (or RCU) read-side critical section");

might_sleep();
init_completion(&rcu.completion);

head->next = NULL;
Expand Down

0 comments on commit 6e6f1b3

Please sign in to comment.