Skip to content

KFunc scx_bpf_this_cid

v7.2

Return the cid of the CPU this program is running on.

Definition

cid-addressed equivalent of bpf_get_smp_processor_id for scx programs. The current cpu is trivially valid, so this is just a table lookup.

Returns

Return the cid of the CPU this program is running on. Return -EINVAL if called from a non-SCX program before any scheduler has ever been enabled (the cid table is still unallocated at that point).

Signature

s32 scx_bpf_this_cid()

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Program types

The following program types can make use of this kfunc:

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome