RCU
include/sync/rcu.h View source View on GitHubStructs
Section titled “Structs”rcu_cpu
Section titled “rcu_cpu”struct rcu_cpu {
_Atomic uint32_t nesting;
_Atomic uint64_t read_gen;
_Atomic uint64_t qs_gen;
uint8_t _pad[64 - (sizeof(uint32_t) + 2 * sizeof(uint64_t)) % 64];
}; rcu_cb
Section titled “rcu_cb”struct rcu_cb {
struct list_head list;
rcu_fn fn;
void *arg;
size_t gen_when_called;
size_t enqueued_waiting_on_gen;
size_t target_gen;
}; rcu_bucket
Section titled “rcu_bucket”struct rcu_bucket {
struct spinlock lock;
struct list_head list;
}; rcu_buckets
Section titled “rcu_buckets”struct rcu_buckets {
struct semaphore sem;
struct rcu_bucket buckets[RCU_BUCKETS];
}; rcu_gp
Section titled “rcu_gp”struct rcu_gp {
_Atomic uint64_t current_gen;
struct rcu_cpu *cpus;
}; Type Aliases
Section titled “Type Aliases”rcu_fn
Section titled “rcu_fn”typedef void (*rcu_fn)(struct rcu_cb * *, void * *); Functions
Section titled “Functions”rcu_synchronize
Section titled “rcu_synchronize”void rcu_synchronize(void); rcu_defer
Section titled “rcu_defer”void rcu_defer(struct rcu_cb *cb, rcu_fn fn, void *arg); rcu_maintenance_tick
Section titled “rcu_maintenance_tick”void rcu_maintenance_tick(void); rcu_read_lock
Section titled “rcu_read_lock”void rcu_read_lock(void); rcu_read_unlock
Section titled “rcu_read_unlock”void rcu_read_unlock(void); rcu_init
Section titled “rcu_init”void rcu_init(void); rcu_worker_notify
Section titled “rcu_worker_notify”void rcu_worker_notify(void); Macros
Section titled “Macros”RCU_BUCKETS
Section titled “RCU_BUCKETS”#define RCU_BUCKETS 2 rcu_cb_from_list_node
Section titled “rcu_cb_from_list_node”#define rcu_cb_from_list_node(ln) (container_of(ln, struct rcu_cb, list)) rcu_dereference
Section titled “rcu_dereference”#define rcu_dereference(p) atomic_load_explicit(&(p), memory_order_acquire) rcu_assign_pointer
Section titled “rcu_assign_pointer”#define rcu_assign_pointer(p, v) \
atomic_store_explicit(&(p), (v), memory_order_release)