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.
Unified · Split
| @@ -190,6 +190,8 @@ static inline int rcu_read_lock_sched_held(void) · 189 unmodified lines | |||
| 190 | 190 | ||
| 191 | #ifdef CONFIG_PROVE_RCU | 191 | #ifdef CONFIG_PROVE_RCU |
| 192 | 192 | ||
| 193 | extern int rcu_my_thread_group_empty(void); | ||
| 194 | |||
| 193 | /** | 195 | /** |
| 194 | * rcu_dereference_check - rcu_dereference with debug checking | 196 | * rcu_dereference_check - rcu_dereference with debug checking |
| 195 | * @p: The pointer to read, prior to dereferencing | 197 | * @p: The pointer to read, prior to dereferencing |
| @@ -122,3 +122,14 @@ void wakeme_after_rcu(struct rcu_head *head) · 121 unmodified lines | |||
| 122 | rcu = container_of(head, struct rcu_synchronize, head); | 122 | rcu = container_of(head, struct rcu_synchronize, head); |
| 123 | complete(&rcu->completion); | 123 | complete(&rcu->completion); |
| 124 | } | 124 | } |
| 125 | |||
| 126 | #ifdef CONFIG_PROVE_RCU | ||
| 127 | /* | ||
| 128 | * wrapper function to avoid #include problems. | ||
| 129 | */ | ||
| 130 | int rcu_my_thread_group_empty(void) | ||
| 131 | { | ||
| 132 | return thread_group_empty(current); | ||
| 133 | } | ||
| 134 | EXPORT_SYMBOL_GPL(rcu_my_thread_group_empty); | ||
| 135 | #endif /* #ifdef CONFIG_PROVE_RCU */ | ||