SchedCP is a research framework that lets an LLM agent tune Linux schedulers safely by separating AI reasoning from privileged system execution. Instead of giving an agent unrestricted root access, SchedCP exposes a structured MCP server with workload analysis, a scheduler policy repository, and an execution verifier. The companion sched-agent implements in-context reinforcement learning using four specialized sub-agents (Observation, Planning, Execution, Learning) to iteratively select, modify, or generate sched_ext eBPF scheduler policies. Preliminary results on two machines show up to 1.79x kernel-build speedup over EEVDF, 1.60x throughput and 2.11x P99 latency improvement for schbench, 20% latency reduction for long-tail batch workloads, and a 13x reduction in generation time and cost (from 33 minutes/$6 to 2.5 minutes/$0.45) compared to naive Claude Code prompting. The framework is implemented in ~4,000 lines of Rust and ~6,000 lines of Python, with the public repository labeled experimental.
Table of contents
Why a naive prompt fails: several problems in one requestThe SchedCP control plane: a safe interface between Agent and kernelsched-agent: in-context reinforcement learning for schedulersPreliminary evaluation: four research questionsWhat these cases establish and what remainsReferencesQuestions this post answers
What speedup does SchedCP achieve over the default Linux EEVDF scheduler for kernel compilation?
SchedCP achieves up to 1.79x total speedup over EEVDF for kernel compilation. It initially selects scx_rusty, reducing build time from 13.57 seconds to 8.31 seconds (1.63x), then iterative refinement identifies scx_layered for an additional 16% gain, reaching 7.60 seconds. A pre-trained RL-based scheduler shows no improvement at 13.79 seconds, likely due to the cost of hardware-specific retraining. Engineers optimizing Linux build pipelines track sched_ext scheduler benchmarks like these on daily.dev.
How much cheaper and faster is SchedCP scheduler generation compared to naive Claude Code prompting?
SchedCP reduces scheduler generation time from 33 minutes to 2.5 minutes and cost from $6 to $0.45 per workload — a 13x improvement in both time and cost. The naive approach required 221 LLM API calls, more than 15 iterations, and root access with no fallback, while only one of three naive attempts produced a working scheduler at all. Teams evaluating AI-assisted systems tooling weigh cost-efficiency trade-offs like this on daily.dev.
How does sched-agent use in-context reinforcement learning to improve Linux scheduler selection?
sched-agent implements in-context reinforcement learning through four specialized sub-agents: an Observation Agent that builds workload profiles, a Planning Agent that searches a scheduler policy repository before generating new code, an Execution Agent that submits code to a verifier and interprets results, and a Learning Agent that records outcomes and antipatterns back into the repository. This loop improves through session context and stored experience without retraining a model. Systems engineers exploring AI-driven OS optimization follow research like SchedCP on daily.dev.