Skip to content

SCX

The kernel concludes a number of example sched_ext BPF schedulers. These examples make use of some common header files that aid in writing schedulers. These are located in tools/sched_ext/include/scx. We document macros inside of these to make following examples easier and because kfuncs and the sched_ext_ops reference them.

Note

These in-tree headers are based on files developed in an out of tree sched-ext/scx project, which moves faster than the kernel. If you are looking for a library to use in your own projects, you may want to look at the out of tree project.

common.bpf.h

This header file provides a number of macros that might be useful when writing schedulers. It also contains forward declarations for most kfuncs that might be of use.

Definitions in this file are:

compat.bpf.h

This header file provides compatibility wrappers that pick the right implementation based on the kernel version, dealing with the fact that the sched_ext implementation is still in flux.

Definitions in this file are: