Skip to content

KFunc bpf_iter_scx_dsq_new

v6.12

This function creates a DSQ iterator.

Definition

Initialize BPF iterator it which can be used with bpf_for_each to walk tasks in the DSQ specified by dsq_id. Iteration using it only includes tasks which are already queued when this function is invoked.

Parameters

it: iterator to initialize

dsq_id: DSQ to iterate

flags: SCX_DSQ_ITER_*

Flags

SCX_DSQ_ITER_REV: iterate in the reverse dispatch order

Returns

0 on success, negative error code on failure

Signature

int bpf_iter_scx_dsq_new(struct bpf_iter_scx_dsq *it, u64 dsq_id, u64 flags)

Note

This kfunc is RCU protected. This means that the kfunc can be called from RCU read-side critical section. If a program isn't called from RCU read-side critical section, such as sleepable programs, the bpf_rcu_read_lock and bpf_rcu_read_unlock to protect the calls to such KFuncs.

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