mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
lockdep: Add an in_workqueue_context() lockdep-based test function
Some recent uses of RCU make use of workqueues. In these uses, execution within the context of a specific workqueue takes the place of the usual RCU read-side primitives such as rcu_read_lock(), and flushing of workqueues takes the place of the usual RCU grace-period primitives. Checking for correct use of rcu_dereference() in such cases requires a test of whether the code is executing in the context of a particular workqueue. This commit adds an in_workqueue_context() function that provides this test. This new function is only defined when lockdep is enabled, which allows it to be used as the second argument of rcu_dereference_check(). Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
This commit is contained in:
parent
71d1d5c722
commit
a25909a4d4
2 changed files with 19 additions and 0 deletions
|
@ -297,4 +297,8 @@ static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg)
|
|||
#else
|
||||
long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg);
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
int in_workqueue_context(struct workqueue_struct *wq);
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue