Linux Kernel
3.7.1
|
Go to the source code of this file.
Data Structures | |
struct | srcu_struct_array |
struct | rcu_batch |
struct | srcu_struct |
Macros | |
#define | srcu_dereference_check(p, sp, c) __rcu_dereference_check((p), srcu_read_lock_held(sp) || (c), __rcu) |
#define | srcu_dereference(p, sp) srcu_dereference_check((p), (sp), 0) |
#define srcu_dereference | ( | p, | |
sp | |||
) | srcu_dereference_check((p), (sp), 0) |
srcu_dereference - fetch SRCU-protected pointer for later dereferencing : the pointer to fetch and protect for later dereferencing : pointer to the srcu_struct, which is used to check that we really are in an SRCU read-side critical section.
Makes rcu_dereference_check() do the dirty work. If PROVE_RCU is enabled, invoking this outside of an RCU read-side critical section will result in an RCU-lockdep splat.
#define srcu_dereference_check | ( | p, | |
sp, | |||
c | |||
) | __rcu_dereference_check((p), srcu_read_lock_held(sp) || (c), __rcu) |
srcu_dereference_check - fetch SRCU-protected pointer for later dereferencing : the pointer to fetch and protect for later dereferencing : pointer to the srcu_struct, which is used to check that we really are in an SRCU read-side critical section.
: condition to check for update-side use
If PROVE_RCU is enabled, invoking this outside of an RCU read-side critical section will result in an RCU-lockdep splat, unless evaluates
to 1. The argument
will normally be a logical expression containing lockdep_is_held() calls.
int __srcu_read_lock | ( | struct srcu_struct * | sp | ) |
void call_srcu | ( | struct srcu_struct * | sp, |
struct rcu_head * | head, | ||
void(*)(struct rcu_head *head) | func | ||
) |
call_srcu() - Queue a callback for invocation after an SRCU grace period : srcu_struct in queue the callback : structure to be used for queueing the SRCU callback. : function to be invoked after the SRCU grace period
The callback function will be invoked some time after a full SRCU grace period elapses, in other words after all pre-existing SRCU read-side critical sections have completed. However, the callback function might well execute concurrently with other SRCU read-side critical sections that started after call_srcu() was invoked. SRCU read-side critical sections are delimited by srcu_read_lock() and srcu_read_unlock(), and may be nested.
The callback will be invoked from process context, but must nevertheless be fast and must not block.
void cleanup_srcu_struct | ( | struct srcu_struct * | sp | ) |
cleanup_srcu_struct - deconstruct a sleep-RCU structure : structure to clean up.
Must invoke this after you are finished using a given srcu_struct that was initialized via init_srcu_struct(), else you leak memory.
int init_srcu_struct | ( | struct srcu_struct * | sp | ) |
init_srcu_struct - initialize a sleep-RCU structure : structure to initialize.
Must invoke this on a given srcu_struct before passing that srcu_struct to any other function. Each srcu_struct represents a separate domain of SRCU protection.
void srcu_barrier | ( | struct srcu_struct * | sp | ) |
srcu_barrier - Wait until all in-flight call_srcu() callbacks complete.
long srcu_batches_completed | ( | struct srcu_struct * | sp | ) |
void synchronize_srcu | ( | struct srcu_struct * | sp | ) |
synchronize_srcu - wait for prior SRCU read-side critical-section completion : srcu_struct with which to synchronize.
Flip the completed counter, and wait for the old count to drain to zero. As with classic RCU, the updater must use some separate means of synchronizing concurrent updates. Can block; must be called from process context.
Note that it is illegal to call synchronize_srcu() from the corresponding SRCU read-side critical section; doing so will result in deadlock. However, it is perfectly legal to call synchronize_srcu() on one srcu_struct from some other srcu_struct's read-side critical section.
void synchronize_srcu_expedited | ( | struct srcu_struct * | sp | ) |
synchronize_srcu_expedited - Brute-force SRCU grace period : srcu_struct with which to synchronize.
Wait for an SRCU grace period to elapse, but be more aggressive about spinning rather than blocking when waiting.
Note that it is illegal to call this function while holding any lock that is acquired by a CPU-hotplug notifier. It is also illegal to call synchronize_srcu_expedited() from the corresponding SRCU read-side critical section; doing so will result in deadlock. However, it is perfectly legal to call synchronize_srcu_expedited() on one srcu_struct from some other srcu_struct's read-side critical section, as long as the resulting graph of srcu_structs is acyclic.