TLDR: SchedCP is a new framework enabling LLM agents to autonomously and safely optimize Linux schedulers. It addresses the ‘semantic gap’ by providing a decoupled control plane with services for workload analysis, policy management, and execution verification. Paired with ‘sched-agent,’ a multi-agent system, it analyzes workloads, synthesizes custom eBPF scheduling policies, and deploys them. This approach achieves up to 1.79x performance improvement and a 13x cost reduction compared to naive AI methods, while ensuring system stability.
Operating system schedulers, the unsung heroes of computing, face a persistent challenge: they often struggle to understand the unique needs of different applications. This disconnect, known as the “semantic gap,” frequently leads to less-than-optimal performance across various computing environments, from vast cloud platforms to personal devices.
Traditional attempts to automate scheduler optimization, such as those using reinforcement learning, have shown some promise but are limited by their inability to grasp the deeper, semantic intent of a workload. The rise of Large Language Model (LLM) agents, capable of reasoning and using tools for software development, offers a new avenue. However, a straightforward application of LLMs can be slow, expensive, and even result in code that degrades system performance, highlighting a need for a more structured approach.
Introducing SchedCP: A Safe Control Plane for AI-Driven Optimization
To bridge this critical gap, researchers have introduced SchedCP, a novel framework designed to enable fully autonomous LLM agents to safely and efficiently optimize Linux schedulers without human intervention. The core idea behind SchedCP is to create a decoupled control plane that clearly separates the AI’s role of semantic reasoning (deciding “what to optimize”) from the system’s role of execution (observing and acting).
Implemented as a Model Context Protocol (MCP) server, SchedCP provides a stable interface with three key services:
- Workload Analysis Engine: This service offers tiered access to system performance data, from high-level summaries to detailed profiling using tools like perf and strace, and even custom eBPF probes. It provides feedback on post-deployment performance metrics, allowing agents to adaptively request information.
- Scheduler Policy Repository: A vector database storing eBPF scheduler code along with rich metadata, including natural language descriptions, target workloads, and historical performance. This allows agents to search for and retrieve relevant schedulers or code primitives, reducing generation costs and promoting reuse.
- Execution Verifier: A crucial multi-stage validation pipeline for all AI-generated code and configurations. It starts with the kernel’s eBPF verifier for memory safety, then adds scheduler-specific static analysis to detect logic bugs like task starvation. Finally, dynamic validation in a secure micro-VM ensures correctness and performance before a monitored canary deployment with an automatic circuit breaker for safety.
sched-agent: A Multi-Agent System for OS Optimization
Building on SchedCP, the researchers developed sched-agent, a multi-agent AI framework for scheduler optimization. This system implements in-context reinforcement learning, where the agent adapts its strategy based on recent performance feedback without costly model retraining. It uses a subagent architecture, mirroring human expert teams, to decompose the optimization process into distinct stages:
- Observation Agent: Builds a comprehensive “Workload Profile” by querying the Workload Analysis Engine, synthesizing data into natural language descriptions and optimization goals.
- Planning Agent: Transforms the Workload Profile into an optimization strategy, querying the Scheduler Policy Repository for existing solutions, generating patches for partial matches, or composing new schedulers from primitives.
- Execution Agent: Manages the development, validation, and deployment process, submitting code to the Execution Verifier and adapting based on feedback (e.g., refining code if static analysis fails, fixing logic if dynamic tests fail).
- Learning Agent: Completes the reinforcement learning loop by analyzing deployment outcomes, identifying success patterns, and updating the Scheduler Policy Repository for long-term improvement.
Also Read:
- Smart Planning for LLM Agents: Balancing Speed and Expense
- AI-Powered Scenario Generation for Complex Service Environments
Demonstrated Power and Efficiency
The evaluation of SchedCP and sched-agent shows significant improvements. For instance, in a Linux kernel compilation benchmark, the system achieved up to a 1.79x performance improvement over the default EEVDF scheduler. On the schbench workload, it delivered a 2.11x improvement in P99 latency and a 1.60x gain in throughput. For diverse batch workloads, AI-generated schedulers consistently reduced end-to-end processing time by an average of 20%.
Crucially, SchedCP also drastically reduces the economic cost and time associated with AI-driven scheduler generation. The time required fell from 33 minutes to just 2.5 minutes (a 13x reduction), and the monetary cost dropped from $6 to $0.5 per iteration, making custom scheduler development economically viable even for short-lived workloads.
This framework represents a significant step towards creating truly self-optimizing, application-aware operating systems, democratizing expert-level system optimization. The code for SchedCP is open-sourced and available for further exploration. You can read the full research paper here: Towards Agentic OS: An LLM Agent Framework for Linux Schedulers.


