提交 ee84b824 编写于 作者: P Paul E. McKenney

rcu: create rcu_my_thread_group_empty() wrapper

Some RCU-lockdep splat repairs need to know whether they are running
in a single-threaded process.  Unfortunately, the thread_group_empty()
primitive is defined in sched.h, and can induce #include hell.  This
commit therefore introduces a rcu_my_thread_group_empty() wrapper that
is defined in rcupdate.c, thus avoiding the need to include sched.h
everywhere.
Signed-off-by: N"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
上级 ad4ba375
...@@ -190,6 +190,8 @@ static inline int rcu_read_lock_sched_held(void) ...@@ -190,6 +190,8 @@ static inline int rcu_read_lock_sched_held(void)
#ifdef CONFIG_PROVE_RCU #ifdef CONFIG_PROVE_RCU
extern int rcu_my_thread_group_empty(void);
/** /**
* rcu_dereference_check - rcu_dereference with debug checking * rcu_dereference_check - rcu_dereference with debug checking
* @p: The pointer to read, prior to dereferencing * @p: The pointer to read, prior to dereferencing
......
...@@ -122,3 +122,14 @@ void wakeme_after_rcu(struct rcu_head *head) ...@@ -122,3 +122,14 @@ void wakeme_after_rcu(struct rcu_head *head)
rcu = container_of(head, struct rcu_synchronize, head); rcu = container_of(head, struct rcu_synchronize, head);
complete(&rcu->completion); complete(&rcu->completion);
} }
#ifdef CONFIG_PROVE_RCU
/*
* wrapper function to avoid #include problems.
*/
int rcu_my_thread_group_empty(void)
{
return thread_group_empty(current);
}
EXPORT_SYMBOL_GPL(rcu_my_thread_group_empty);
#endif /* #ifdef CONFIG_PROVE_RCU */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册