PatchworkOS  69292a3
A non-POSIX operating system.
Loading...
Searching...
No Matches
rcu.c File Reference
#include <kernel/cpu/cpu.h>
#include <kernel/cpu/ipi.h>
#include <kernel/log/log.h>
#include <kernel/mem/cache.h>
#include <kernel/sync/lock.h>
#include <kernel/sync/rcu.h>
#include <stdlib.h>
#include <sys/bitmap.h>
Include dependency graph for rcu.c:

Go to the source code of this file.

Data Structures

struct  rcu_t
 
struct  rcu_synchronize_t
 

Functions

static BITMAP_CREATE_ZERO (ack, CPU_MAX)
 
 PERCPU_DEFINE_CTOR (static rcu_t, pcpu_rcu)
 
static void rcu_synchronize_callback (void *arg)
 
void rcu_synchronize (void)
 Wait for all pre-existing RCU read-side critical sections to complete.
 
void rcu_call (rcu_entry_t *entry, rcu_callback_t func, void *arg)
 Add a callback to be executed after a grace period.
 
static bool rcu_check_quiescent (void)
 
static void rcu_advance (bool wake)
 
static void rcu_start_grace (void)
 
static void rcu_invoke_callbacks (void)
 
void rcu_report_quiescent (void)
 Called during a context switch to report a quiescent state.
 
void rcu_call_free (void *arg)
 Helper callback to free a pointer.
 
void rcu_call_cache_free (void *arg)
 Helper callback to free a cache object.
 

Variables

static uint64_t grace = 0
 
static bool active = false
 
static lock_t lock = LOCK_CREATE()
 

Function Documentation

◆ BITMAP_CREATE_ZERO()

static BITMAP_CREATE_ZERO ( ack  ,
CPU_MAX   
)
static

◆ PERCPU_DEFINE_CTOR()

PERCPU_DEFINE_CTOR ( static  rcu_t,
pcpu_rcu   
)

Definition at line 25 of file rcu.c.

Here is the call graph for this function:

◆ rcu_synchronize_callback()

static void rcu_synchronize_callback ( void *  arg)
static

Definition at line 47 of file rcu.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rcu_check_quiescent()

static bool rcu_check_quiescent ( void  )
static

Definition at line 88 of file rcu.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rcu_advance()

static void rcu_advance ( bool  wake)
static

Definition at line 113 of file rcu.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rcu_start_grace()

static void rcu_start_grace ( void  )
static

Definition at line 135 of file rcu.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rcu_invoke_callbacks()

static void rcu_invoke_callbacks ( void  )
static

Definition at line 164 of file rcu.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ grace

uint64_t grace = 0
static

Definition at line 12 of file rcu.c.

◆ active

bool active = false
static

Definition at line 13 of file rcu.c.

◆ lock

lock_t lock = LOCK_CREATE()
static

Definition at line 14 of file rcu.c.