scx/scheds/rust/scx_lavd
Changwoo Min f470b1aa13 scx_lavd: always inline submit_task_ctx to make the verifier happy
In _some_ kernel versions, loading scx_lavd fails with an error of
"bpf_rcu_read_unlock is missing". The usage of
bpf_rcu_read_lock/unlock() in proc_dump_all_tasks() is correct but the
bpf verifier still think bpf_rcu_read_unlock() is missing. The most
plausible reason so far is that the problematic kernel does not have a
commit 6fceea0fa59f ("bpf: Transfer RCU lock state between subprog
calls"), failing inter-procedural analysis between proc_dump_all_tasks()
and submit_task_ctx(). Thus, we force inline submit_task_ctx() (no
inter-procedural analysis by the verifier is necessary) for the time
being.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-04-28 00:11:38 +09:00
..
src scx_lavd: always inline submit_task_ctx to make the verifier happy 2024-04-28 00:11:38 +09:00
.gitignore scx_lavd: Add .gitignore 2024-04-04 07:15:37 -10:00
build.rs scx_lavd: add scx_lavd (Latency-criticality Aware Virtual Deadline) scheduler 2024-03-16 10:31:07 +09:00
Cargo.toml Cargo.toml: Update libbpf-rs/cargo dependencies to 0.23 and drop patch.crates-io sections 2024-04-02 11:19:39 -10:00
LICENSE scx_lavd: add scx_lavd (Latency-criticality Aware Virtual Deadline) scheduler 2024-03-16 10:31:07 +09:00
meson.build scheds-rust: build rust schedulers in sequence 2024-04-23 08:06:27 +08:00
README.md scx_lavd: add scx_lavd (Latency-criticality Aware Virtual Deadline) scheduler 2024-03-16 10:31:07 +09:00
rustfmt.toml scx_lavd: add scx_lavd (Latency-criticality Aware Virtual Deadline) scheduler 2024-03-16 10:31:07 +09:00

scx_lavd

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_lavd is a BPF scheduler that implements an LAVD (Latency-criticality Aware Virtual Deadline) scheduling algorithm. While LAVD is new and still evolving, its core ideas are 1) measuring how much a task is latency critical and 2) leveraging the task's latency-criticality information in making various scheduling decisions (e.g., task's deadline, time slice, etc.). As the name implies, LAVD is based on the foundation of deadline scheduling. This scheduler consists of the BPF part and the rust part. The BPF part makes all the scheduling decisions; the rust part loads the BPF code and conducts other chores (e.g., printing sampled scheduling decisions).

Typical Use Case

scx_lavd is initially motivated by gaming workloads. It aims to improve interactivity and reduce stuttering while playing games on Linux. Hence, this scheduler's typical use case involves highly interactive applications, such as gaming, which requires high throughput and low tail latencies.

Production Ready?

This scheduler could be used in a production environment where the current code is optimized. The current code does not particularly consider multiple NUMA/CCX domains, so its scheduling decisions in such hardware would be suboptimal. This scheduler currently will mainly perform well on single CCX / single-socket hosts.