Skip to main content

Module kernel

Module kernel 

Source
Expand description

The kernel’s own view of sched_ext, read straight from sysfs.

scx.service only knows whether its unit is active; the kernel knows what is actually attached. Reading /sys/kernel/sched_ext lets the UI show ground truth and flag disagreements — a scheduler launched by hand next to the service, a scheduler that got kicked out by the watchdog while the unit is still active, and so on. Everything here is plain world-readable sysfs, so no privileges are needed.

Re-exports§

use std::fs; 🔒
use std::path::Path; 🔒
use anyhow::Context; 🔒
use anyhow::Result; 🔒

Structs§

KernelState

Constants§

SYSFS_DIR 🔒

Functions§

read
Reads the kernel’s sched_ext state. Ok(None) means the sysfs directory is absent, i.e. the running kernel was built without sched_ext; Err means it is there but state could not be read, which is a different fact and must not be reported as the former. root/ops is absent while nothing is attached, so NotFound on it is not an error; any other failure on it is.