mirror of
https://github.com/torvalds/linux.git
synced 2024-12-02 17:11:33 +00:00
rcu: add rcu_read_lock_sched() / rcu_read_unlock_sched()
Add rcu_read_lock_sched() and rcu_read_unlock_sched() to rcupdate.h to match the recently added write-side call_rcu_sched() and rcu_barrier_sched(). They also match the no-so-recently-added synchronize_sched(). It will help following matching use of the update/read lock primitives. Those new read lock will replace preempt_disable()/enable() used in pair with RCU-classic synchronization. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Acked-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
3a72dc8eb5
commit
1c50b728c3
@ -132,6 +132,26 @@ struct rcu_head {
|
|||||||
*/
|
*/
|
||||||
#define rcu_read_unlock_bh() __rcu_read_unlock_bh()
|
#define rcu_read_unlock_bh() __rcu_read_unlock_bh()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* rcu_read_lock_sched - mark the beginning of a RCU-classic critical section
|
||||||
|
*
|
||||||
|
* Should be used with either
|
||||||
|
* - synchronize_sched()
|
||||||
|
* or
|
||||||
|
* - call_rcu_sched() and rcu_barrier_sched()
|
||||||
|
* on the write-side to insure proper synchronization.
|
||||||
|
*/
|
||||||
|
#define rcu_read_lock_sched() preempt_disable()
|
||||||
|
|
||||||
|
/*
|
||||||
|
* rcu_read_unlock_sched - marks the end of a RCU-classic critical section
|
||||||
|
*
|
||||||
|
* See rcu_read_lock_sched for more information.
|
||||||
|
*/
|
||||||
|
#define rcu_read_unlock_sched() preempt_enable()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rcu_dereference - fetch an RCU-protected pointer in an
|
* rcu_dereference - fetch an RCU-protected pointer in an
|
||||||
* RCU read-side critical section. This pointer may later
|
* RCU read-side critical section. This pointer may later
|
||||||
|
Loading…
Reference in New Issue
Block a user