Towards Agentic OS: An LLM Agent Framework for Linux Schedulers
Yusheng Zheng, Yanpeng Hu, Wei Zhang, Andi Quinn · 2025
Read Towards Agentic OS: An LLM Agent Framework for Linux Schedulers by Yusheng Zheng, Yanpeng Hu, Wei Zhang, Andi Quinn (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2509-01245.txt.
Introduction
Linux schedulers decide which programs run when, but kernel rules cannot grasp what each application truly needs. Yusheng Zheng, Yanpeng Hu, Wei Zhang, and Andi Quinn present SchedCP, a framework that lets language model agents tune schedulers on their own, safely. The key move is a split control plane: the agent reasons about what to optimize, while the system controls how to observe and act.
Built as a protocol server, SchedCP offers a workload analysis engine, a growing store of scheduler policies, and a verifier that checks all agent-made code before it runs. A multi-agent system built on it shows the design at work. Zheng and the team argue this split, not a stronger model alone, makes autonomous scheduler tuning practical.
Catalog record
| CREATOR | Yusheng Zheng, Yanpeng Hu, Wei Zhang, Andi Quinn |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 14 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2509-01245
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Towards Agentic OS: An LLM Agent Framework for Linux Schedulers Yusheng Zheng, Yanpeng Hu, Wei Zhang, Andi Quinn Abstract Operating system schedulers suffer from a fundamental semantic gap, where kernel policies fail to understand application-specific needs, leading to suboptimal performance. We introduce SchedCP, the first framework that enables fully autonomous Large Language Model (LLM) agents to safely and efficiently optimize Linux schedulers without human involvement. Our core insight is that the challenge is not merely to apply a better LLM, but to architect a decoupled control plane that separates the AI’s role of semantic reasoning ("what to optimize") from the system’s role of execution ("how to observe and act"), thereby separating the optimization problem into two stages: goal-inference and policy-synthesis. Implemented as Model Context Protocol(MCP) server, SchedCP provides a stable interface with three key services: a Workload Analysis Engine, an evolving Scheduler Policy Repository, and an Execution Verifier that validates all AI-generated code and configurations before deployment with static and dynamic analysis. We demonstrate this architecture’s power with sched-agent, a multi-agent system that autonomously analyzes workloads, synthesizes custom eBPF scheduling policies, and deploys them via the sched_ext infrastructure. Our evaluation shows that SchedCP achieves up to 1.79x performance improvement and 13x cost reduction compared to naive agentic approaches, all while maintaining high success rate. The code is in https://github.com/eunomia-bpf/schedcp . 1 Introduction Operating system schedulers face a fundamental challenge: kernel policies cannot understand what applications need, leading to suboptimal performance as Linux’s EEVDF scheduler eevdf2024 applies one-size-fits-all policies to diverse workloads. While sched_ext schedext2024 in Linux 6.12 enables custom extended Berkeley Packet Filter(eBPF) schedulers with safety guarantees through verification, developing them still requires both deep kernel expertise and a good understanding of the workloads. Prior reinforcement learning-based schedulers mao2019decima ; qiu2020firm lack semantic understanding of workloads, are often limited to tweaking configurations within a problem space predefined by human engineers, preventing fully automatic system optimization. While LLMs openai2023gpt4 ; anthropic2024claude and agent frameworks autogen ; geminicli ; claudecode ; qian2024chatdev ; hong2023metagpt excel at code generation, naively applying them to scheduler development proves impractical: our experiments show generating a basic scheduler takes 33 minutes, costs $6, and often degrades performance. The gap remains: existing methods lack semantic understanding, while LLMs lack the scaffolding for safe, efficient, and reliable systems integration despite prior LLM-eBPF work kgent . Our work enables a system to drive its own optimization by decomposing the problem into two stages: a goal-inference stage that uncovers optimization goals and constraints from workloads, and a policy-synthesis stage that compiles them into eBPF scheduler policies. This approach is embodied in a decoupled architecture with two components. First, SchedCP is a control plane framework providing safe AI-kernel interfaces with profiling, tracing and validation tools, allowing LLMs to customize the kernel scheduler with eBPF. It exposes kernel scheduling features via Model Context Protocol (MCP) through three core services: Workload Analysis Engine, Scheduler Policy Repository, and Execution Verifier. Second, sched-agent is the first autonomous multi-agent system that decomposes scheduler optimization into four specialized agents (Observation, Planning, Execution, Learning), demonstrating how LLMs can bridge the semantic gap between application requirements and kernel scheduling policies. This separation allows SchedCP to provide a generalizable framework for any AI agent, while sched-agent demonstrates semantic workload analysis and policy generation. Our evaluation shows sched-agent achieves up to 1.79× performance on kernel compilation, 2.11× P99 latency improvement and 1.60× throughput gain on schbench, 20% latency reduction for batch workloads, and 13× cost reduction. 2 Motivation Linux scheduler optimization faces three barriers. First, a domain knowledge gap exists between developers and users: DevOps engineers lack insight into workload characteristics (latency-sensitive vs. throughput-oriented), while edge/personal device users lack both kernel optimization expertise and understanding of application-specific targets. Second, scheduler development requires mastering kernel programming, limiting innovation to a few experts. Third, modern workloads exhibit complex dynamics: web traffic varies by orders of magnitude daily, build system parallelism changes with dependencies. Prior RL-based schedulers mao2019decima ; qiu2020firm ; zhang2024mrsch ; mao2019park require extensive training per workload type, lack semantic understanding to transfer across workloads, and only tweak configurations after engineers have already defined the entire problem space: selecting features, specifying knobs, and writing objective functions. LLMs uniquely bridge these gaps by: (1) using tools to dynamically explore diverse workloads to uncover application intent and structure, which is difficult to capture with conventional static or dynamic analysis; (2) applying a broad, pre-trained understanding of source code semantics to reason about performance trade-offs and structural dependencies, such as data-dependency hints; (3) synthesizing correct eBPF schedulers based on this analysis; and (4) operating in the control plane to generate optimized code that runs natively with negligible runtime overhead, unlike traditional ML models that would cause unacceptable inference latency in the scheduler hot path. We tested Claude Code claudecode , the state-of-the-art LLM agent, with "write a FIFO scheduler in eBPF" from an empty folder, with all permissions and bash access. Of three attempts, only one succeeded. The second attempt produced pseudo-code after 6 minutes trying, and the third generated a scheduler tracer instead after 8 minutes of development. The successful generation required 33 minutes, 221 LLM API calls, and 15+ iterations, costing $6 (vs. 5 minutes typically for an expert developer). The generated code, for some workloads, exhibited poor quality with excessive overhead, performing worse than EEVDF. The agent required root access, could crash the system during testing, and lacked fallback mechanisms, which also raises safety concerns. These experiments reveal three critical challenges: Performance , ensuring AI schedulers outperform existing ones; Safety , preventing crashes, lockups, and starvation while minimizing privileges; and Efficiency , reducing the 33-minute, $6 generation cost for practical deployment. 3 The SchedCP Framework Design and Implementation Figure 1 : Overall architecture of SchedCP and sched-agent. SchedCP (bottom) provides the system interface with three core services: Workload Analysis Engine, Scheduler Policy Repository, and Execution Verifier. sched-agent (top) implements the AI logic through four specialized agents (Observation, Planning, Execution, Learning) working in a closed loop. Red lines show initialization when detecting new workloads, black arrows show optimization loops, and green arrows indicate tool usage by agents. As illustrated in Figure 1 , SchedCP is a secure control plane acting as an ’API for OS optimization,’ separating systems infrastructure from AI logic, distinguishing “what to optimize” (AI’s domain) from “how to observe and act” (system’s domain). Four key principles govern its design. First, decoupling and role separation ensures future-proofing by treating the AI agent as a performance engineer using a stable set of tools. Second, safety-first interface design addresses the inherent risks of autonomous agents with kernel access by treating AI as potentially non-cautious actors, designing defensive interfaces that prevent catastrophic failures by default, and avoiding granting ‘root’ privileges. Third, adaptive context provisioning addresses LLM agents’ constraints from finite context windows and token costs: agents start with minimal summaries and progressively request details as needed. Finally, composable tool architecture follows Unix philosophy by providing atomic tools that let agents construct complex workflows through their reasoning capabilities, enabling novel solution generation rather than constraining them with rigid workflows. Implemented in 4000 lines of Rust and 6000 lines of Python (including tests), SchedCP provides essential tools for any agent to interact with the Linux kernel’s scheduler,