scx-upstream/scheds/rust/scx_rustland/build.rs

12 lines
386 B
Rust
Raw Normal View History

scx_rustlite: simple user-space scheduler written in Rust This scheduler is made of a BPF component (dispatcher) that implements the low level sched-ext functionalities and a user-space counterpart (scheduler), written in Rust, that implements the actual scheduling policy. The main goal of this scheduler is to be easy to read and well documented, so that newcomers (i.e., students, researchers, junior devs, etc.) can use this as a template to quickly experiment scheduling theory. For this reason the design of this scheduler is mostly focused on simplicity and code readability. Moreover, the BPF dispatcher is completely agnostic of the particular scheduling policy implemented by the user-space scheduler. For this reason developers that are willing to use this scheduler to experiment scheduling policies should be able to simply modify the Rust component, without having to deal with any internal kernel / BPF details. Future improvements: - Transfer the responsibility of determining the CPU for executing a particular task to the user-space scheduler. Right now this logic is still fully implemented in the BPF part and the user-space scheduler can only decide the order of execution of the tasks, that significantly restricts the scheduling policies that can be implemented in the user-space scheduler. - Experiment the possibility to send tasks from the user-space scheduler to the BPF dispatcher using a batch size, instead of draining the task queue completely and sending all the tasks at once every single time. A batch size should help to reduce the overhead and it should also help to reduce the wakeups of the user-space scheduler. Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2023-12-14 06:54:25 +00:00
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2.
fn main() {
scx_utils::BpfBuilder::new()
.unwrap()
.enable_intf("../../../rust/scx_rustland_core/src/bpf/intf.h", "bpf_intf.rs")
.enable_skel("../../../rust/scx_rustland_core/src/bpf/main.bpf.c", "bpf")
scx_rustlite: simple user-space scheduler written in Rust This scheduler is made of a BPF component (dispatcher) that implements the low level sched-ext functionalities and a user-space counterpart (scheduler), written in Rust, that implements the actual scheduling policy. The main goal of this scheduler is to be easy to read and well documented, so that newcomers (i.e., students, researchers, junior devs, etc.) can use this as a template to quickly experiment scheduling theory. For this reason the design of this scheduler is mostly focused on simplicity and code readability. Moreover, the BPF dispatcher is completely agnostic of the particular scheduling policy implemented by the user-space scheduler. For this reason developers that are willing to use this scheduler to experiment scheduling policies should be able to simply modify the Rust component, without having to deal with any internal kernel / BPF details. Future improvements: - Transfer the responsibility of determining the CPU for executing a particular task to the user-space scheduler. Right now this logic is still fully implemented in the BPF part and the user-space scheduler can only decide the order of execution of the tasks, that significantly restricts the scheduling policies that can be implemented in the user-space scheduler. - Experiment the possibility to send tasks from the user-space scheduler to the BPF dispatcher using a batch size, instead of draining the task queue completely and sending all the tasks at once every single time. A batch size should help to reduce the overhead and it should also help to reduce the wakeups of the user-space scheduler. Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2023-12-14 06:54:25 +00:00
.build()
.unwrap();
}