Lines Matching +full:a +full:- +full:h

6 This directory contains a number of example sched_ext schedulers. These
11 Some of the examples are performant, production-ready schedulers. That is, for
12 the correct workload and with the correct tuning, they may be deployed in a
25 There are a few toolchain dependencies for compiling the example schedulers.
32 is actively working on adding a BPF backend compiler as well, but are still
47 non-trivial ones.
51 In order to run a sched_ext scheduler, you'll have to run a kernel compiled
52 with the patches in this repository, and with a minimum set of necessary
72 There is a `Kconfig` file in this directory whose contents you can append to
76 ## Getting a vmlinux.h file
78 You may notice that most of the example schedulers include a "vmlinux.h" file.
79 This is a large, auto-generated header file that contains all of the types
81 [BTF](https://docs.kernel.org/bpf/btf.html) (i.e. with the BTF-related Kconfig
84 The header file is created using `bpftool`, by passing it a vmlinux binary
88 $ bpftool btf dump file /path/to/vmlinux format c > vmlinux.h
91 `bpftool` analyzes all of the BTF encodings in the binary, and produces a
93 example, using vmlinux.h allows a scheduler to access fields defined directly
97 #include "vmlinux.h"
98 // vmlinux.h is also implicitly included by scx_common.bpf.h.
99 #include "scx_common.bpf.h"
102 * vmlinux.h provides definitions for struct task_struct and
108 bpf_printk("Task %s enabled in example scheduler", p->comm);
111 // vmlinux.h provides the definition for struct sched_ext_ops.
119 The scheduler build system will generate this vmlinux.h file as part of the
120 scheduler build pipeline. It looks for a vmlinux file in the following
129 4. `/boot/vmlinux-$(uname -r)`
131 In other words, if you have compiled a kernel in your local repo, its vmlinux
132 file will be used to generate vmlinux.h. Otherwise, it will be the vmlinux of
133 the kernel you're currently running on. This means that if you're running on a
134 kernel with sched_ext support, you may not need to compile a local kernel at
137 ### Aside on CO-RE
140 [CO-RE](https://nakryiko.com/posts/bpf-core-reference-guide/) (Compile Once Run
143 BPF program on a different kernel with the field at a different offset. In our
144 example above, we print out a task name with `p->comm`. CO-RE would perform
150 Once you have your toolchain setup, and a vmlinux that can be used to generate
151 a full vmlinux.h file, you can compile the schedulers using `make`:
154 $ make -j($nproc)
164 https://github.com/sched-ext/scx.
168 A simple scheduler that provides an example of a minimal sched_ext scheduler.
172 well on single-socket systems with a unified L3 cache.
177 a basic weighted FIFO queuing policy. It also provides examples of some common
178 useful BPF features, such as sleepable per-task storage allocation in the
180 enqueue tasks. It also illustrates how core-sched support could be implemented.
184 A "central" scheduler where scheduling decisions are made from a single CPU.
185 This scheduler illustrates how scheduling decisions can be dispatched from a
197 A flattened cgroup hierarchy scheduler. This scheduler implements hierarchical
198 weight-based cgroup CPU control by flattening the cgroup hierarchy into a single
200 is a much more performant CPU controller, which does not need to descend down
201 cgroup trees in order to properly compute a cgroup's share.
204 reasonably well on single socket-socket systems with a unified L3 cache and show
210 There are a number of common issues that you may run into when building the
218 …failed due to requirement 'SCX_DSQ_FLAG_BUILTIN': bpftool generated vmlinux.h is missing high bits…
227 1. `which clang` to make sure you're using a sufficiently new version of clang.
237 ### Stale kernel build / incomplete vmlinux.h file
239 As described above, you'll need a `vmlinux.h` file that was generated from a
241 you'll see errors such as the following which indicate that a type being
242 referenced in a scheduler is unknown:
245 /path/to/sched_ext/tools/sched_ext/user_exit_info.h:25:23: note: forward declaration of 'struct scx…
253 [Getting a vmlinux.h file](#getting-a-vmlinuxh-file) in order to ensure your
254 schedulers are using a vmlinux.h file that includes the requisite types.
263 Auto-detecting system features:
264 ... clang-bpf-co-re: [ on ]