#include <linux/export.h>
#include <linux/mutex.h>
#include <linux/percpu.h>
#include <linux/preempt.h>
#include <linux/rcupdate.h>
#include <linux/sched.h>
#include <linux/smp.h>
#include <linux/delay.h>
#include <linux/srcu.h>
Go to the source code of this file.
#define SRCU_CALLBACK_BATCH 10 |
#define SRCU_RETRY_CHECK_DELAY 5 |
#define SYNCHRONIZE_SRCU_EXP_TRYCOUNT 12 |
#define SYNCHRONIZE_SRCU_TRYCOUNT 2 |
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.
Definition at line 371 of file srcu.c.
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.
Definition at line 280 of file srcu.c.
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.
Definition at line 134 of file srcu.c.
srcu_barrier - Wait until all in-flight call_srcu() callbacks complete.
Definition at line 495 of file srcu.c.
srcu_batches_completed - return batches completed. : srcu_struct on which to report batch completion.
Report the number of batches, correlated with, but not necessarily precisely the same as, the number of grace periods that have elapsed.
Definition at line 508 of file srcu.c.
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.
Definition at line 465 of file srcu.c.
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.
Definition at line 486 of file srcu.c.