[PATCH 2/8] srcu: add might_sleep() annotation to synchronize_srcu()

From: Lai Jiangshan
Date: Thu Nov 29 2012 - 03:45:03 EST


synchronize_srcu() can sleep but it will not sleep if the fast path
succeeds. This annotation will helps us to catch the problem early
if it is called in a wrong contex which can't sleep.

Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
---
kernel/srcu.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/srcu.c b/kernel/srcu.c
index b2e4f36..48d0edb 100644
--- a/kernel/srcu.c
+++ b/kernel/srcu.c
@@ -417,6 +417,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;
--
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/