Skip to content

DPCs

include/thread/dpc.h View source View on GitHub
struct dpc (5 fields) source
§ dpc_func_t func
§ void *a
§ void *b
§ atomic(struct dpc *) next

for MPSC push

§ atomic_bool enqueued

prevents double-enqueue

struct dpc_context (1 field) source
§ struct dpc *dpc
struct dpc_queue (1 field) source
§ atomic(struct dpc *) head

Per-cpu DPC data

struct dpc_cpu (1 field) source
§ struct dpc_queue queue
typedef void (*dpc_func_t)(struct dpc_context * d, void * a, void * b)
source
typedef void (*dpc_fanout_fn_t)(void)
source
void dpc_drain_local(void)
source
void dpc_run_local(void)
source
void dpc_run_dpcs_from_irq(void)
source
struct dpc * dpc_create(dpc_func_t fn, void *a, void *b)
source
struct dpc * dpc_init(struct dpc *d, dpc_func_t fn, void *a, void *b)
source
void dpc_fanout(
    struct dpc *cc_nonnull_ptr,
    struct cpu_mask cpus,
    dpc_fanout_fn_t cc_nonnull_ptr
)
source

Run fn once on every CPU in cpus, returning only after all of them complete.

NOTE

storage must hold at least popcount(cpus) DPCs, this is what the caller must uphold. storage entries get overwritten every call as well

void dpc_init_percpu(void)
source
bool dpc_enqueue_local(struct dpc *d)
source
bool dpc_enqueue_on_cpu(size_t cpu, struct dpc *cc_nonnull_ptr)
source