mirror of
https://github.com/sched-ext/scx.git
synced 2024-12-01 07:00:23 +00:00
4520514fe8
As described in https://bugzilla.kernel.org/show_bug.cgi?id=218109, https://github.com/sched-ext/scx/issues/147 and https://github.com/sched-ext/sched_ext/issues/69, AMD chips can sometimes report fully disabled CPUs as offline, which causes us to count them when looking at /sys/devices/system/cpu/possible. Additionally, systems can have holes in their active CPU maps. For example, a system with CPUs 0, 1, 2, 3 possible, may have only 0 and 2 active. To address this, we need to do a few things: 1. Update topology.rs to be clear that it's returning the number of _possible_ CPUs in the system. Also update Topology to only record online CPUs when creating its span and iterating over sysfs when creating domains. It was previously trying to record when a CPU was online, but this was actually broken as the topology directory isn't present in sysfs when the CPU is offline. 2. Schedulers should not be relying on nr_possible_cpus for anything other than interacting with per-CPU data (e.g. for stats extraction), or e.g. verifying maximum sizes of statically sized arrays in BPF. It should _not_ be used for e.g. performing load calculations, etc. With that said, we'll also need to update schedulers to not rely on the nr_possible_cpus figure being exported by the topology crate. We do that for rusty in this patch, but don't fix any of the others other than updating how they call topology.rs. 3. Account for the fact that LLC IDs may be non-contiguous. For example, if there is a single core in an LLC, then if we assign LLC IDs to domains, then the domain IDs won't be contiguous. This doesn't fit our current model which is used by e.g. infeasible_weights.rs. We'll update some of the code in rusty to accomodate this, but we'll need to do more. 4. Update schedulers to properly reset themselves in the event of a hotplug event. We'll take care of that in a follow-on change. Signed-off-by: David Vernet <void@manifault.com> |
||
---|---|---|
.. | ||
src | ||
.gitignore | ||
build.rs | ||
Cargo.toml | ||
LICENSE | ||
meson.build | ||
README.md | ||
rustfmt.toml |
scx_rlfifo
This is a single user-defined scheduler used within sched_ext, which is a Linux kernel feature which enables implementing kernel thread schedulers in BPF and dynamically loading them. Read more about sched_ext.
Overview
scx_rlfifo is a simple FIFO scheduler runs in user-space, based on the scx_rustland_core framework.
Typical Use Case
This scheduler is provided as a simple template that can be used as a baseline to test more complex scheduling policies.
Production Ready?
Definitely not. Using this scheduler in a production environment is not recommended, unless there are specific requirements that necessitate a basic FIFO scheduling approach. Even then, it's still recommended to use the kernel's SCHED_FIFO real-time class.