[tip:core/rcu] srcu: Add might_sleep() annotation to synchronize_srcu()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  6e6f1b307e23201fb3e7aaf16322e80355d2a3d5
Gitweb:     http://git.kernel.org/tip/6e6f1b307e23201fb3e7aaf16322e80355d2a3d5
Author:     Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
AuthorDate: Thu, 29 Nov 2012 16:46:03 +0800
Committer:  Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
CommitDate: Thu, 7 Feb 2013 15:08:19 -0800

srcu: Add might_sleep() annotation to synchronize_srcu()

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@xxxxxxxxxxxxxx>
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
---
 kernel/srcu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/srcu.c b/kernel/srcu.c
index c9d003b..3e43a21 100644
--- a/kernel/srcu.c
+++ b/kernel/srcu.c
@@ -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;
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux