Skip to content

KFunc scx_bpf_pick_idle_cpu_node

v6.15

Pick and claim an idle cpu from node

Definition

Pick and claim an idle cpu in cpus_allowed from the NUMA node @node.

The search starts from @node and proceeds to other online NUMA nodes in order of increasing distance (unless SCX_PICK_IDLE_IN_NODE is specified, in which case the search is limited to the target node).

Always returns an error if ops.update_idle is implemented and SCX_OPS_KEEP_BUILTIN_IDLE is not set, or if SCX_OPS_BUILTIN_IDLE_PER_NODE is not set.

Parameters

cpus_allowed: Allowed cpumask

node: target NUMA node

flags: SCX_PICK_IDLE_* flags

Flags

enum scx_pick_idle_cpu_flags {
    SCX_PICK_IDLE_CORE      = 1LLU << 0,
    SCX_PICK_IDLE_IN_NODE   = 1LLU << 1,
};

SCX_PICK_IDLE_CORE: pick a CPU whose SMT siblings are also idle

SCX_PICK_IDLE_IN_NODE: pick a CPU in the same target NUMA node

Returns

The picked idle cpu number on success, or -EBUSY if no matching cpu was found.

Signature

s32 scx_bpf_pick_idle_cpu_node(const struct cpumask *cpus_allowed, int node, u64 flags)

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