Conceptio › Archive › arXiv CS
arXiv CS open access

Polymorph: Operating System Kernel Optimization Through Artificial Intelligence

Dean Sysman et al. · arxiv_cs
arXiv CS · Papers
Open Source ↗Direct PDF ↓
kerneloperating-systemsvirtualization
While popular operating systems such as Linux and Windows were originally designed as monolithic kernels, an increasing number of kernel subsystems have become extensible using eBPF. Users can now define custom policies for essential kernel mechanisms, such as the process scheduler, page cache, and
Conceptio Open Archive

Analyze & explore related research in Conceptio

Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.

P OLYMORPH : O PERATING S YSTEM K ERNEL O PTIMIZATION THROUGH A RTIFICIAL I NTELLIGENCE

arXiv:2611.23644v1 [cs.OS] 18 Nov 2026

Dean Sysman 1 Georgios Liargkovas 1 Tal Zussman 1 Hasan Zengin 1 Petra Hedesiu 1 Hubertus Franke 2 Tamar Eilam 2 Kostis Kaffes 1 Asaf Cidon 1

A BSTRACT While popular operating systems such as Linux and Windows were originally designed as monolithic kernels, an increasing number of kernel subsystems have become extensible using eBPF. Users can now define custom policies for essential kernel mechanisms, such as the process scheduler, page cache, and network stack, without recompiling the kernel. These mechanisms give developers significant freedom to fit the kernel to their applications’ workloads, but the question of which policy to deploy remains open. We study how to use agentic AI to automate kernel policy development, selection, and deployment, focusing on the page cache and the process scheduler as two representative subsystems. We show that existing approaches fall short: evolutionary and agentic search runs offline, is relatively expensive, and often fails to generalize to online workloads, while online knob tuners are encumbered by the knobs’ lack of expressivity. In contrast, we propose Polymorph, which learns online: an AI agent writes a generalized, granular policy once, and a user mode tuner adjusts its parameters during runtime, with no LLM in the loop. For the page cache, Polymorph improves throughput over Linux’s LRU by 8.4% on unseen data, nearly twice the gain of the best existing policy, while adapting to workload changes at runtime and costing only 16M tokens once, versus 125–240M tokens per workload for agentic offline search. For the process scheduler, it improves on Linux’s default by 2.75× across six workloads, versus 2.27× for the best fixed sched_ext policy. 1

I NTRODUCTION

Legacy operating systems, such as Linux and Windows, were designed as monolithic OSes with fixed, predefined interfaces and data structures, which give applications limited ways to control their behavior. For example, the Linux page cache implements an approximation of the LeastRecently-Used (LRU) policy and lets applications tweak it with “hints” through the madvise() and fadvise() interfaces. However, prior work has shown that these hints may have little impact on the behavior of the underlying policy (Zussman et al., 2025; Lee et al., 2026). In recent years, mainline operating systems have become more extensible through the eBPF framework, which allows applications to safely run custom, verified code in the kernel (Linux Kernel Development Community, 2026). Beyond its original uses in networking, security, and tracing, eBPF now extends subsystems such as scheduling, memory management, and storage. For example, sched_ext and cache_ext allow applications to load custom policies for process scheduling and page cache eviction, respecColumbia University 2 IBM. Correspondence to: Dean Sysman <ds4597@columbia.edu>.

tively (Hodges, 2024; Zussman et al., 2025). Custom policies matter because no single policy suits every application, and Linux alone makes hundreds of such policy decisions, most of which cannot be changed without rebuilding the kernel (Qin et al., 2026). LLM-based code generation now makes new policies cheap to write (Novikov et al., 2025; Cheng et al., 2025), which shifts the bottleneck to designing and deploying the right one. This is difficult: the design space is broad, it is hard to predict how a workload will behave under a given policy, and workloads change while they run, so a policy that suits one phase can hurt the next. In this paper, we explore how AI and agentic workflows can help develop and select custom OS policies, and we investigate several approaches for using AI and agents to design, implement, and deploy them. We find that the most effective approach is to use AI once to build a policy that adapts itself online as the workload changes, which performs consistently on unseen data and costs less than generating policies offline (§6.1.3–6.2).

1

Preprint.

Offline agentic iterations. Recent evolutionary frameworks, such as OpenEvolve (Sharma, 2025) and SkyDiscover (Liu et al., 2026), iteratively generate and evaluate

Polymorph: Operating System Kernel Optimization through Artificial Intelligence

algorithms that optimize a particular objective (e.g., throughput or cache hit rate) on an offline trace. We use these tools to generate eBPF code, verify it, and load it into the kernel as a novel page cache or scheduling policy (§4.1). We find that these policies generally yield poor results: they are expensive and do not generalize to online, unseen data. Such frameworks optimize only the objective function, while treating the system (an operating system running applications with particular workloads) as a black box. We therefore incorporate “white box” information about the workload, such as OS-level I/O traces, into the feedback loop (§4.2). This results in significant improvements over “vanilla” OpenEvolve, but the core problems of the offline approach remain: it is expensive, requiring many iterations on offline data, and it fails to generalize to new, unseen workloads. Online parameter search. OS configuration tuners search the parameters that the kernel exposes (Alipourfard et al., 2017; Van Aken et al., 2017; Wang et al., 2018), increasingly with LLMs (Lao et al., 2024; Chen et al., 2024). TuxBot (Liargkovas et al., 2026) tunes them online, so it is lightweight and can react to workload changes, but it can only choose among behaviors that existing policies implement. When TuxBot tunes existing Linux knobs such as fadvise() (§4.3), it results in coarse effects, such as disabling readahead entirely. Polymorph: AI-driven online policies. We propose Polymorph, a novel approach to AI-driven OS customization that combines the benefits of both approaches (§5). Polymorph uses AI agents to create new eBPF-based policies that generalize and react to workload changes, without invoking LLMs at runtime. We apply Polymorph to two OS policies, the page cache and the process scheduler. For the page cache, on 11 production traces and data that no approach saw during generation, Polymorph improves throughput over Linux’s LRU by 8.4% on average, versus 4.2% for the best existing cache_ext policy. Offline-generated policies gained at most 3%. Generating a policy with Polymorph costs about 16M tokens once, versus 125–240M tokens per workload for agentic offline search. For the process scheduler, Polymorph improves on Linux’s default scheduler by 2.75× on average across six workloads, versus 2.27× for the best fixed sched_ext policy, and adapts to workload changes within 2.5 seconds. We make the following contributions: • We show that offline AI-generated OS policies are expensive and do not generalize to unseen workloads, while tuning existing knobs online is too limited (§4.1–4.3). • We design Polymorph, which uses an AI agent once to write an eBPF policy with tunable parameters, and a

non-LLM userspace tuner that adapts them online (§5). • We evaluate Polymorph on 17 workloads across the page cache (11) and the process scheduler (6) (§6).

2

BACKGROUND

2.1

Customizing OS Policies with eBPF

eBPF (Extended Berkeley Packet Filter) is a Linux framework for safely running custom code in the kernel with the help of a verifier to ensure safety. It was initially envisioned as a way to filter and forward packets in kernel space without having to copy them into userspace. Over the past decade, it has expanded from this initial use case to many domains, including tracing, memory and storage (Lee et al., 2026; Zhong et al., 2022; Cao et al., 2024; Zussman et al., 2026a), and scheduling (Kaffes et al., 2021; Humphries et al., 2021). Recently, frameworks like sched_ext and cache_ext allow applications to load custom eBPF policies for scheduling and page cache eviction, respectively, without having to recompile the kernel (Hodges, 2024; Zussman et al., 2025). Such policies can be switched out or adjusted live by using shared memory regions between userspace and eBPF programs. These frameworks turn hard-coded kernel mechanisms into flexible, customizable subsystems. Page cache. By default, Linux approximates LRU with an active and an inactive list per cgroup. Newly added pages enter the inactive list and are promoted to the active list when accessed again. Reclaim evicts pages from the tail of the inactive list and demotes pages from the active list to keep the two balanced. MGLRU, merged in Linux 6.1, generalizes this to multiple generations ordered by access recency. cache_ext exposes eviction to eBPF: a policy implements hooks that run when pages are added to, accessed in, or removed from the page cache, and when the kernel needs eviction candidates. The policy tracks pages in its own eviction lists and returns eviction candidates by iterating over these lists with a callback. Policies are attached per cgroup, so different applications can run different policies. cache_ext ships with several such policies, including LFU, LHD (Beckmann et al., 2018) and S3-FIFO (Yang et al., 2023), which we use as baselines in our experiments. Scheduling. Linux’s default scheduler for normal tasks is EEVDF (Earliest Eligible Virtual Deadline First), which replaced CFS in Linux 6.6. EEVDF tracks each task’s virtual runtime and runs the eligible task with the earliest virtual deadline, which is derived from the task’s weight and time slice. sched_ext adds a new scheduling class whose operations, such as selecting a CPU and enqueueing and dispatching tasks, are implemented in eBPF. If the eBPF scheduler errors or stalls runnable tasks, the kernel unloads it and falls back to the default scheduler.

Polymorph: Operating System Kernel Optimization through Artificial Intelligence

OS Policy Tuning

Besides replacing a policy, users can adjust existing OS policies. Linux exposes over 140 performance-related runtime parameters (or knobs) through sysctl, sysfs, and debugfs. These include scheduler time slices, CPU frequency limits, and readahead sizes, along with hints such as fadvise(). Xkernel further expands this knob set by making OS constants tunable on a running kernel (Chen et al., 2026). Traditionally, performance engineers chose knob values through manual experimentation and rules of thumb. Automated tuners replace that process with a search over knob values against a measured objective, typically driven by Bayesian optimization (Curino et al., 2020) or reinforcement learning (Karthikeyan et al., 2023). Recently, TuxBot replaced the optimizer with an LLM that reasons about knob semantics and system telemetry to tune these parameters on a live host (Liargkovas et al., 2026; 2025).

3

M OTIVATION : W HY D O W E N EED P OLICY C USTOMIZATION ?

OS policy choice can have a dramatic effect on application performance (Zussman et al., 2026b; Lee et al., 2026; Kaffes et al., 2021). To demonstrate this, we vary the policy of two OS mechanisms, the page cache and the CPU scheduler, and measure how real workloads respond. Page cache. For the page cache, we run a collection of 11 storage traces from Twitter (Yang et al., 2020) on a key-value store (LevelDB), and Meta (Meta Platforms, 2026) directly through the filesystem, while varying the OS page cache eviction policy. We try five different policies. The first two are hard-coded Linux page cache policies: the LRU (least-recently used) approximate policy, and the more recently introduced MGLRU (multi-generational least-recently used) policy, which ships on some Linux distributions. We also test three eBPF-based policies from the cache_ext paper: LFU, LHD (Beckmann et al., 2018)) and S3FIFO (Yang et al., 2023). We run each trace three times on each cache policy. Our experimental setup is described in §6. The choice of page cache policy alone changes end-to-end throughput substantially (Figure 1). For example, on Twitter cluster 34 (“T34” in the figure), LevelDB’s throughput is about 50% higher with cache_ext’s LFU, the best policy, than with the kernel’s MGLRU, the worst. Moreover, no single policy is best on all workloads, or even on a majority of them, and the winner follows no clear pattern. Process scheduler. Unsurprisingly, the OS process scheduler policy can also significantly affect the performance of individual applications. We ran four workloads with Linux’s default scheduler, EEVDF, and with four

80

T4

50

T7

100

40

25

0 LFU LHD S3F LRU MGL

0 LFU LHD S3F LRU MGL

100

Average Throughput

2.2

T18

40

50

60

T29

T19

T52

T34

0 LFU LHD S3F LRU MGL 50

T45

25

0 LFU LHD S3F LRU MGL 120

T24

40

12

0 LFU LHD S3F LRU MGL

0 LFU LHD S3F LRU MGL 80

0 LFU LHD S3F LRU MGL 24

30

80

50

20

0 LFU LHD S3F LRU MGL

T17

Meta

40

60

0 LFU LHD S3F LRU MGL

0 LFU LHD S3F LRU MGL

0 LFU LHD S3F LRU MGL LFU LHD S3FIFO LRU (Linux) MGLRU (Linux) Tied (1 s.d.)

Figure 1. LevelDB (Twitter) and filesystem (Meta) throughput with different page cache policies. Policy EEVDF (default) sched_ext default Long-slice Wake-boost Per-socket

CPU-bound (k/s ↑)

OLTP + batch (ms ↓)

OLTP (ms ↓)

Xapian (ms ↓)

7.6 10.1 14.3 4.5 10.5

17.9 10,159 4,437 4.3 36.2

8.90 3.25 2.81 2.76 2.86

57.2 14.7 15.8 15.4 15.0

Table 1. Batch throughput (CPU-bound) and p99 latency (others) of four workloads under EEVDF and four sched_ext policies. Median of three runs. The best result is in bold.

sched_ext (Hodges, 2024) policies, and measured throughput for batch work and 99th-percentile (p99) latency for several services (Table 1). Each workload runs on 11 hardware threads. The CPU-bound workload runs 11 always-busy batch threads alongside 44 threads that compute briefly and sleep, and the other three are services driven at a fixed request rate: a PostgreSQL database under Sysbench OLTP (Kopytov, 2020), alone or with 11 batch threads, and the Xapian search engine (Kasture & Sanchez, 2016). The policies differ in a few ways. sched_ext’s default policy runs all tasks FIFO from one global queue with 20 ms time slices. Long-slice favors throughput: it gives every task a 20 ms slice, and a task that wakes up never moves ahead of tasks that are already waiting. Wakeboost favors responsiveness: it uses 5 ms slices and lets a newly woken task pass up to 16 ms of waiting work. Persocket keeps a separate queue for each socket and uses 5 ms slices. The best policy for one workload can be the worst for another. On a CPU-bound workload, long-slice nearly doubles batch throughput over EEVDF, because batch threads keep their CPUs for long stretches. Wake-boost performs worst on this workload, 41% below EEVDF, because threads that wake up often jump ahead of the batch threads. The ranking flips when a PostgreSQL database running Sysbench OLTP (Kopytov, 2020) shares the CPUs with batch threads. With long-slice, database processes wait behind 20 ms batch slices, the database falls behind, and P99 latency grows from

Polymorph: Operating System Kernel Optimization through Artificial Intelligence

writes eBPF code 5

Program pool scored variants

1

Verifier

2

Candidate policy eBPF, via cache_ext

compile + check

rejected = 0

3 4

Score

OFFLINE

Trace replay

6

offline search deployment

Kernel

Live workload

best policy, fixed

unseen data

no further search once deployed

Figure 2. Offline policy generation with OpenEvolve.

Average LevelDB Throughput

Test kernel LLM / agent

120000 100000 80000

q qqqqqqqqqqqqqqqqq qqqqqqqqqq q qq q qq qqqqqqqq qqqqqqqqqqqq q qqqqqqqqqqqqqqq qqqqqqq qqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq qqqqqqq q qq q q q q qq q q q qqq q q qq q q q q q qq qq q q q q qq qq q q q q

60000 40000

Trend line

20000 0

qqqqqq q q qqqq q q q qqqqq qqqqqq q qqqqq q qqqqqqqqq qq qq qqqq q qq qqqq q qq q qq qqqq q 0

50

100

150

200

250

300

OpenEvolve Iteration 18 ms with EEVDF to 4.4 s. Wake-boost lets them jump ahead and cuts P99 latency to 4.3 ms, 4× below EEVDF. For services that run alone, such as the same database or the Xapian search engine, every sched_ext policy lowers P99 latency by 3–4×, likely because it serves tasks in arrival order rather than sharing each CPU among them. On Xapian, sched_ext’s default policy and per-socket do best. These observations point to a recurring pattern: OS policies significantly impact workload performance, and a policy that suits one workload can severely hurt another. No single policy can therefore be deployed once for all applications. Instead, operators need a way to choose and adapt OS policies for each application and workload.

4

E XISTING AI- BASED A PPROACHES

In this section, we explore two offline approaches (evolutionary methods and iteration with agentic coding) and one online approach (online parameter tuning) for OS policy development, and demonstrate why they cannot efficiently adapt OS policies to online workloads. 4.1

Evolutionary Search Using LLMs

Recent work (Cheng et al., 2025; Maas et al., 2026; Dwivedula et al., 2025) applies evolutionary search-style algorithms inspired by AlphaEvolve (Novikov et al., 2025) to systems contexts. Such systems take an offline trace or use a synthetic simulator, and generate a policy to try to optimize the objective (e.g., throughput, latency, cache hit rate), and based on the achieved score create a new iteration of the policy. These frameworks generally have LLMs generate different hypotheses, which are tested on real data, validated, and then discarded or merged. In order to test this approach, we use OpenEvolve (Sharma, 2025), an open source variant of AlphaEvolve, and generate custom eBPF page cache policies for cache_ext. We also tested the SkyDiscover (Liu et al., 2026) framework, but it failed to generate eBPF code that passed the verifier. Figure 2 shows how we deployed OpenEvolve in the context of eBPF-based policies. We use an LLM (Gemini 3.1

Figure 3. Throughput using OpenEvolve on Twitter cluster 17.

Pro, which we found performed best with OpenEvolve) to 1 generate an eBPF caching policy ⃝. The policy is then 2 If it fails, the compiled and must pass the eBPF verifier ⃝. LLM tries to create a new eBPF policy. If it succeeds, it is loaded into the kernel, and we then measure how well it performs on a short online trace, which is a random segment 3 from a cache trace ⃝. We first “warm up” each run for 45 seconds, and then measure the “score” (i.e., LevelDB’s 4 average throughput) over the next 4 minutes of the trace ⃝. We save the eBPF program into a “program pool” alongside its score, and OpenEvolve continues to iterate. At the end of the run, we load the highest scoring eBPF policy into the 5 kernel, and use it for the rest of the trace on unseen data ⃝. Figure 3 shows how the score improves over successive iterations. Interestingly, a large portion of the attempts fail to compile or result in an error (indicated by throughput of 0). In addition, the improvement is not monotonic – OpenEvolve tests different hypotheses, some of which fail. Nevertheless, the overall trend is positive: OpenEvolve achieves higher throughput over time on the offline trace. However, in our experiments, OpenEvolve did not produce significant throughput increases over the default kernel and cache_ext policies, even on its short offline traces. Figure 4 plots the average throughput comparing the best performing cache_ext policy among LFU, LHD and S3FIFO, to the kernel’s LRU, MGLRU and OpenEvolve. OpenEvolve did not achieve the highest performing throughput in any cluster, and it only managed to achieve higher throughput than the default cache_ext policies in Twitter cluster 24. When examining the policies produced by OpenEvolve, they were extremely overfitted, with various hard coded parameters that seem to be designed to perform well on the particular last trace it was run on. This approach failed to yield generalizable policies. 4.2

White Box Agentic Iterations

We observe that a significant disadvantage of OpenEvolvestyle approaches is that they treat the entire system as a black box and try to optimize the score by tinkering with it.

Polymorph: Operating System Kernel Optimization through Artificial Intelligence Best cache_ext (LFU / LHD / S3FIFO)

OpenEvolve

T17

T18

T19

T24

T29

S3FIFO

S3FIFO

S3FIFO

S3FIFO

LHD

T7

T4

LFU

LFU

S3FIFO

LFU

LFU

MGLRU

LFU

Average Throughput

LRU

120 100 80 60 40 20 0

T34

T45

T52

Meta

Figure 4. Average throughput for short runs on offline traces on the cache traces, comparing OpenEvolve with the cache_ext and kernel policies. Best cache_ext (LFU / LHD / S3FIFO)

OpenEvolve

White box: key-value trace

White box: I/O traces

T17

T18

T19

T24

T29

LFU

T34

S3FIFO

S3FIFO

S3FIFO

LHD

T7

T4

S3FIFO

LFU

S3FIFO

LFU

LFU

MGLRU

LFU

Average Throughput

LRU

120 100 80 60 40 20 0

T45

T52

Meta

Average Throughput

Figure 5. Average throughput for short runs (45 s warm-up followed by a 4-minute measurement) on the cache traces. White box: k-v trace, 4 min interval

White box: k-v trace, 4 × 1 min intervals

White box: I/O traces, 4 min interval

White box: I/O traces, 4 × 1 min intervals

120 100 80 60 40 20 0 T4

T7

T17

T18

T19

T24

T29

T34

T45

T52

Figure 6. White box offline approach when running on four 1minute offline intervals versus one 4-minute interval.

In our case, the black box is quite complex: it is a live server running an operating system, running production traces on a relatively complicated storage system (LevelDB), which may interact with each layer of the system unpredictably. Therefore, we seek a more “white box” form of iterative learning, where we can pass additional information gleaned about the workload or from the previous run to the next iteration besides just the final score. Since OpenEvolve’s framework currently prevents adding such feedback loops, we simply ran the same iterative process using Claude Code (Opus 5). In addition, we test how well we can generate policies by augmenting the feedback loop depicted in Figure 2 with two types of information: the logical key-value accesses (e.g., GET Key=1, SET Key=3 Value=4) of the offline trace, and the OS-based I/O trace collected from the cgroup, specifically the number of read and written bytes, and the page accesses and faults. We instruct the agent to go through a loop of generating a policy, compiling it, loading it, and testing it on a particular offline trace, resulting in an average throughput score. We also ask it to compare the policy to the existing policies and other policies it gener-

ated, learn whether it can be improved, and to find a policy that would yield the highest throughput while remaining generalizable (to avoid overfitting). White box vs. black box. We plot the average throughput over the 4 minute offline trace in Figure 5. We compare the “white box” approach to OpenEvolve using two types of information: either feeding the model the request trace, or feeding it I/O traces. For the Meta trace, we only developed an I/O trace-based policy, as the trace runs on the filesystem, not a key-value store. The results show that the white box approach on average performs slightly better than OpenEvolve, and the differences are most pronounced in Twitter clusters T4 and T17, where OpenEvolve had significant throughput drops compared to the best cache_ext policy. In addition, we can see there is almost no difference between feeding the model the key-value trace and providing it with raw I/O traces. Using different offline intervals. Our experiments so far all used a single 4-minute offline trace. In order to confirm that we are not overfitting the caching policies to that particular segment, we run another experiment where we split up the offline trace into four different 1-minute intervals that are taken from different positions in the trace, at 25M, 50M, 75M and 100M requests. The results, presented in Figure 6), yield almost identical performance against the offline traces. General limitations of offline iterative approaches. Beyond failing to achieve consistently higher throughput using the offline traces, there are two additional problems with both offline iterative approaches (OpenEvolve and our white box iterative method). First, the approaches are very expen-

Polymorph: Operating System Kernel Optimization through Artificial Intelligence TuxBot

ONLINE

Application

stats 2

1

user kernel

Application

LLM tuner

samples every 5 s 2

4

system stats (perf, /proc)

Polymorph

ONLINE

3

Monitor

1

existing interface

samples every 2 s

LRU eviction fixed

hints

4

params map

stats map

5

5

Default kernel policy Page cache

Tuner one parameter at a time

2

user kernel

fadvise()

3

Monitor

Online eBPF policy

Access advice

Page cache

readahead, drop, etc.

Figure 7. TuxBot tuning fadvise() online. As the application 1 TuxBot observes stats ⃝, 2 picks a value ⃝ 3 and sets it runs ⃝, 4 providing hints to the fixed LRU policy ⃝. 5 via fadvise() ⃝,

L0

L1

L2

L3

promote if count ≥ list threshold, else evict

1 reaches the eBPF Figure 8. Polymorph’s online policy. I/O ⃝ 2 The controller periodically reads stats ⃝ 3 and re-tunes a policy ⃝. 4 ⃝. 5 parameter ⃝

sive. Unsurprisingly, hundreds of iterations on a 4 minute trace, where each iteration requires generating eBPF code, compiling it successfully, and loading it, can be quite expensive. We present a full cost analysis in Section 6.1.4. Second, the LLM is trying to optimize its score using an offline trace. However, access patterns and workloads can change over time. In the evaluation we show that when run on “unseen” online traces, these policies often fail to generalize (§6.1.1).

head is not the problem, the hint has nothing to offer, yet the choice of eviction policy still matters. On T17, for example, no hint improves throughput by more than 2%, whereas switching to MGLRU improves it by 9%. Disabling readahead can even backfire, lowering MGLRU’s throughput by 9–13% on T17 and T18. Knobs such as fadvise() make coarse-grained decisions, but they cannot choose which pages stay in the cache. That choice belongs to the eviction policy, which is what cache_ext lets us customize. In the rest of the paper we treat readahead as orthogonal.

4.3

5

Limitations of Online Knob Tuning

A natural alternative to writing new policies is to tune the knobs the kernel already exposes while the workload runs. TuxBot (Liargkovas et al., 2026) does this with an LLM in the loop. However, Tuxbot is currently limited to a certain set of OS parameters and interfaces, namely the default scheduler, power, and writeback knobs, which do not control the page cache. We therefore augmented Tuxbot and gave it access to the interface that most directly controls the page cache during application runtime, the posix_fadvise access hint, applied live to every data file, and let it tune the hint with throughput feedback (Figure 7).

D ESIGN : O NLINE L EARNING WITH P OLYMORPH

At first glance the result seems impressive, as TuxBot raised throughput on T24 by up to 77%. On closer inspection, every run converged to the same hint, FADV_RANDOM, which simply disables readahead. While disabling readahead can be advantageous to the traces we measured (traces that exhibit significant random read access patterns), it could significantly harm performance for scan-heavy workloads. Interestingly, none of the other five hints helped, and with the random hint removed TuxBot gained only 3%. Online tuning added nothing beyond that single setting. Setting FADV_RANDOM by default did as well or better, because TuxBot lost time trying other hints before settling on it.

Overview. We introduce Polymorph, a novel approach to automating OS policies that can adapt online to live workloads. Polymorph applies the same design to the page cache and to the process scheduler. For each policy, it consists of a generalized kernel policy, loaded through eBPF, whose behavior is set by parameters in a map shared with user space, and a user mode component, the tuner, which reads system statistics every 2 seconds and writes new parameter values into the map (Figure 8). The kernel policy reads the map at its next decision, so it adapts continuously to the running workload without being reloaded. In the offline loop of Figure 2, an LLM generates and evaluates a new version of the policy in every iteration. In Polymorph, an agent writes the policy and the tuner once, and importantly, no LLM is called during the online loop. The two policies differ in what they control and in what their tuners read. The cache policy, built on cache_ext, manages a hierarchy of four lists, and its tuner reads I/O, page, and cgroup statistics and adjusts one parameter at a time. The scheduler policy, built on sched_ext, manages run queues, wakeup priority, and time slices, and its tuner reads CPU utilization and CPU time per wakeup and selects one of three settings (§5.3).

The gain thus comes from switching off one mechanism, not from tuning. Readahead fills a small cache with pages that are never read, so disabling it helps by 37–63% on the Twitter clusters where this happens (T24, T34, T52), but by at most 2% on T17 and Meta. On workloads where reada-

Figure 8 shows the main components and the flow over one iteration for the page cache. The kernel policy is loaded into the kernel through eBPF and cache_ext, and it manages the pages of the running workload in a hierarchy of four 1 The user mode tuner reads I/O, page, and cgroup lists ⃝.

Polymorph: Operating System Kernel Optimization through Artificial Intelligence 2 selects a parameter to adjust in sequential orstatistics ⃝, 3 and updates the shared parameter map ⃝. 4 The new der ⃝, 5 In the next iteration, values apply to the kernel policy ⃝. the tuner checks the result and decides whether to keep the adjustment or revert it.

5.1

Generalized Cache Policy

We seek OS policies that can be adapted to each workload. However, as we show in the next section, the offline approaches do not hold up on unseen data. Learning must therefore be continuous and online, while the workload runs. The challenge is that we require very lightweight mechanisms (in terms of cost and performance overhead) to switch between different policies in response to workload changes. Our main observation is that across the existing cache policies and the ones generated by offline learning, the variation between policies can be described by a small set of parameters: the number of lists, the rules for promoting or evicting folios between them, and what to do on a folio access. This led us to design a general cache data structure that can represent a wide variety of caching policies by changing only its parameters, without reloading or flushing the policy as it adapts to workload changes. The policy is a hierarchy of four lists, and it promotes or evicts folios between the lists. Four parameters are adjustable: the access-count threshold for promotion or eviction in each list, the weight, or ratio of sizes, between the lists, the initial access count of a folio in each list, and the frequency cap at which each list stops promoting. We chose these parameters to make the policy as granular as possible, so that selecting the right parameter values yields the right policy. “Classic” caching policies can easily be implemented by this structure: for example, segmented LRU (SLRU) (Karedla et al., 1994) can be approximated by treating each list as a separate LRU queue, and the movement between the queues and eviction can be controlled using the lists’ access counts. 5.2

User Mode Tuner

While the kernel policy is loaded and the workload runs, the user mode tuner selects adjustments that customize the policy to the changing patterns of the workload, and it applies them by updating the parameters through a map shared between the kernel and user space. The generalized policy therefore stays in place, and each adjustment adds minimal overhead. The tuner reads the signals that are relevant and available from user mode: per-CPU counters and list sizes, the I/O statistics of the block device, and the memory statistics of the cgroup. The tuner then scores the current configuration by page touches per second. Then it chooses to tune one of the

available parameters at a time. A trial change is kept only if it beats a freshly measured baseline by more than 4% twice in a row; otherwise, it is reverted and the search direction flips. After a second rejection, the tuner holds the current setting, and if performance falls below 95% of the best seen, it restores the best configuration. Communication flows through shared BPF maps: statistics flow to the user mode tuner, which writes new parameters directly into the memory-mapped parameter struct of the policy, and the new values take effect on the next eviction scan, with no reload or re-attach. This logic lets the tuner respond to changes in the workload’s patterns continuously, without disrupting performance as long as the changes do not show clear gains. Crucially, Polymorph never calls LLMs during its runtime, and all of its decisions come from the dynamic policy that is controlled by the tuner, deterministically. To set the initial parameter values of the kernel policy and the user mode tuner, we used an AI agent (Claude) for a one-shot analysis of one cluster, T34, which we chose for its complexity. In the next section, we show that even though we tuned the initial parameters on only one cluster, the throughput gains hold across multiple clusters. 5.3

Generalized Scheduler Policy

We now show how Polymorph can be applied to the scheduler use case. We observe that the scheduling policies in Table 1 differ in three decisions: whether all CPUs share one run queue or each socket has its own, how far a task that has just woken up may move ahead of tasks that are already waiting, and how long a task runs before it returns to the queue. Therefore, Polymorph’s scheduler is one sched_ext policy that keeps these three decisions as parameters in a shared eBPF map (Appendix A): the queue scope (shared or per socket), the wake boost (how much waiting time a woken task may skip, from 0 to 1 s), and the time slice (from 0.05 to 20 ms). Every scheduling callback reads the map, so a new setting applies from the next scheduling decision, without reloading the policy. Long-slice, wake-boost, and per-socket are settings of this one policy. The tuner reads only system counters, never the application’s latency or throughput (since these are not often not reported by the application). Every 2 seconds, it reads three perf counters on the workload’s CPUs and computes two statistics: the number of busy CPUs, and the CPU time per wakeup, which is the busy CPU time divided by the number of task wakeups. When the CPUs are at least 99% busy and each wakeup brings 400 µs of CPU time or more, the workload is CPU-bound, and the tuner selects Long-slice. When the CPUs are at least 99% busy with shorter runs per wakeup, request threads compete with batch work, and it selects Wake-boost. When the CPUs are less busy, it selects

Polymorph: Operating System Kernel Optimization through Artificial Intelligence LRU

MGLRU

Best cache_ext (LFU / LHD / S3FIFO)

Evolutionary Offline

Best Agentic Offline

Polymorph IO

S3FIFO I-IO

LFU LFU

I-Req

Req

LHD

20

I-IO

LFU

Req

LHD

I-IO

LHD

IO

LFU

IO

LFU S3FIFO

40

IO

60

Req

80 S3FIFO

Average Throughput

100

0 T4

T7

T17

T18

T19

T24

T29

T34

T45

T52

Meta

Figure 9. Average throughput on the 11 cache traces. For cache_ext and Agentic Offline, the bar shows the best-performing variant on that workload, and its name is printed inside the bar (I-Req and I-IO are the interval request-data and interval I/O-signal variants).

8 ∆ throughput vs. LRU (%)

Per-socket. Similar to the caching use case, an AI coding agent (Claude Code) wrote the policy and the tuner once, from runs of the four workloads in Table 1, and the same code serves every workload. Appendix A lists the counters and thresholds.

4 0 −4 −8

5.4

The same loop applies to other OS policies (Qin et al., 2026) when three conditions hold. First, userspace must be able to replace the policy at runtime, through an eBPF extension point, as for prefetching (Cao et al., 2024), page fault handling (Zussman et al., 2026a), and in-kernel storage functions (Zhong et al., 2022), or through a framework that delegates the policy to user space (Humphries et al., 2021; Kaffes et al., 2021). Second, the policy must read its parameters from memory it shares with the tuner (eBPF map), so that they can change without a reload. Third, the tuner needs system statistics that reflect how the workload uses the subsystem, such as hardware counters or tracepoints.

6

E VALUATION

We evaluate how Polymorph compares with existing approaches for generating OS policies with AI, in performance and in cost, first for the page cache and then for the process scheduler (§6.2). We answer three questions. Q1: How does Polymorph perform compared with existing caching policies and with policies that AI generates offline? Q2: Does Polymorph generalize to unseen online workloads? Q3: How does the cost of Polymorph compare with existing AI-based approaches? 6.1

MGLRU S3FIFO

Other Subsystems

Case Study 1: Page Caching

System configuration. We run our page cache experiments on Cloudlab (Duplyakin et al., 2019) c6525-25g machines, each with a 16-core AMD Rome CPU, 128GB of memory, and a 480GB SSD, running Ubuntu 22.04 with Linux

LFU

LHD

Evol. OffOffline Req†

OffIO

OffIReq†

Off- Polymorph IIO†

Figure 10. Average throughput difference from the baseline kernel LRU across the 11 workloads. Policies marked † Averaged over the ten Twitter clusters only, because the Meta workload has a single agentic offline (I/O-signal) policy.

v6.6.8. To make our results reproducible, we pin each experiment to its CPUs, disable SMT, swap, and address space randomization, and drop the page cache before each test. Workloads and baselines. We use 10 clusters of the Twitter cache workloads (Yang et al., 2020) and the Meta block storage workload (Meta Platforms, 2026), which are realworld production records of cache accesses with varied types, patterns, and scale. Each cluster runs on LevelDB with a memory limit of 10% of the cluster’s data size, so that the page cache evicts pages regularly. We measure average throughput and compare against the kernel’s default LRU policy, the kernel’s MGLRU, and the LHD, LFU, and S3FIFO policies implemented on cache_ext. Test runs. A short run has a 45-second warm-up followed by a 4-minute measurement. A long run has a 5-minute warm-up followed by a 25-minute measurement, on a part of the trace that starts after the data of the short run and does not overlap it. 6.1.1

Offline Search Policies (Q1)

In §4.2 and Figures 5 and 6 we showed experiments where offline policy generation tries to outperform existing policies on data it has seen. The offline approaches generated their policies from the short runs, and we test the policies on the

Polymorph: Operating System Kernel Optimization through Artificial Intelligence

same short runs. While the approaches were competitive with existing policies, they did not significantly outperform them, even on the unseen data. Takeaway 1: LLM-based evolutionary search and AI agents can generate cache policies that are valid eBPF programs that are competitive on real-world workloads. 6.1.2

Offline Search on Unseen Workloads (Q2)

Next, we ask how the offline policies perform on data they have not seen, using the long runs. The results are presented in Figure 9. The performance of the offline policies drops, and they rarely outperform LRU or the cache_ext policies. In aggregate (Figure 10), every offline policy trails the static cache_ext policies LFU and LHD. The best offline policy improves throughput by 2.9% over LRU, compared with 3.9% for LFU and 4.2% for LHD. The intervals somewhat prevent overfitting, but the offline policies still do not underperform the cache_ext LFU and LHD policies. Takeaway 2: The offline approach cannot adequately address unseen data and in the generic case does not create a gain compared to existing approaches. 6.1.3

How Does Polymorph Perform (Q2)

On the same long runs, Polymorph achieves the highest throughput on average, and best or tied on 5 of 11 clusters (Figure 9). In aggregate, it improves throughput over LRU by 8.4%, nearly twice the gain of the best other policy, LHD, at 4.2% (Figure 10). The generalized policy can represent the policy that each workload needs by changing only its parameters, and the user mode tuner learns from I/O signals when and where to adjust the parameters it shares with the kernel policy. As a result, Polymorph tailors the policy to each workload automatically, without any further calls to an LLM or an agent. Takeaway 3: Polymorph does best due to its ability to generically adjust to workloads. 6.1.4

Cost (Q3)

Approach

Recurrence

Tokens

Dollars

OpenEvolve (Offline) White Box (Offline) Polymorph

Per Cluster Per Cluster One time

10M 125M–240M 16M

$300 $3750–$7200 $480

Duration 12–24 Hours 1–3 Days <1 Hour

Table 2. Cost range comparison of approaches.

The approaches widely differ in their cost and the time it takes to generate the policies (Table 2). With OpenEvolve and the white box, each iteration makes one LLM call, which generates a mutation of the code, and then runs the evaluation score function, which does not use AI. Importantly, this search must be repeated for each cluster. The white box approach is much more expensive (and time con-

suming) than “vanilla” open evolve, because it has to incorporate and analyze white box signals from the workload. In contrast, Polymorph needs a single agent prompt, which receives the policy structure and generates the kernel policy and the user mode tuner. The agent also sets the default values of the tuner’s hyperparameters in one shot, by reading only the requests of the short run of one cluster (T34, chosen for its complexity). Crucially, the same code then serves every workload, so Polymorph pays this cost only once: amortized over our 11 clusters, it uses about 1.5M tokens per cluster, 7× fewer than evolutionary search and 86–165× fewer than agentic search. 6.2

Case Study 2: Process Scheduler

We next evaluate Polymorph on a second OS policy, the process scheduler, and answer Q1 and Q2 for it. System configuration. We use a Cloudlab (Duplyakin et al., 2019) c6320 machine (two 14-core Intel Xeon E5-2683 v3 CPUs, 256GB of memory) running Ubuntu 22.04 with Linux v6.17, and pin each workload to 11 CPU threads. Online scheduler. We evaluate the scheduler of §5.3, whose tuner switches one sched_ext policy among the Longslice, Wake-boost, and Per-socket settings of Table 1. Offline baseline. Following the offline loop of Figure 2, a separate, sandboxed Claude Code session wrote a sched_ext policy from scratch, scoring each attempt by its average improvement over EEVDF on the same four workloads (with seeds our test runs do not use); we deploy its best policy unchanged. We evaluate on the four seen workloads of Table 1, in runs of 15–45 seconds after a short warm-up, and in the same way on two unseen workloads that neither agent ran: Silo, an in-memory TPC-C database from TailBench (Kasture & Sanchez, 2016), and the PostgreSQL OLTP workload alone at 4k transactions/s. A changing run plays six 60-second stages back to back (CPU-bound, OLTP + batch, Xapian, CPU-bound, Silo, OLTP 4k) without telling the tuner when a stage begins; the last two run separately, from the setting at the end of the fourth. We measure batch throughput on CPU-bound and p99 latency on the others, and compare Polymorph with EEVDF, the four sched_ext policies, and the agentic offline policy. 6.2.1

Offline and Online Search Performance

On the four seen workloads, Polymorph matches the best sched_ext policy on three and comes within 7% of it on OLTP (Figure 11a). The best policy differs between workloads, and each sched_ext policy is worse than EEVDF on at least one of them (§3). The tuner tells these cases apart from its two statistics and selects a suitable setting within

Polymorph: Operating System Kernel Optimization through Artificial Intelligence

Improvement over EEVDF

sched_ext default

Long-slice

Wake-boost

Per-socket

Agentic offline

Polymorph

EEVDF (1×)

Long-slice Wake-boost Per-socket

Long-slice

CPU-bound OLTP + batch tput ↑ p99 ↓

CPU-bound tput ↑

Per-socket

8× 4× 2× 1× 0.5× 0.01×

0.002×

0.004×

Unseen

Unseen

0.001× CPU-bound OLTP + batch tput ↑ p99 ↓

OLTP p99 ↓

Xapian p99 ↓

Silo p99 ↓

OLTP 4k/s p99 ↓

Geo. mean

(a) Per workload

Xapian p99 ↓

Silo p99 ↓

OLTP 4k/s p99 ↓

(b) Changing workload (online)

Figure 11. Mean improvement over EEVDF. (a) Per-run end-to-end improvement. (b) Per-second improvement, across 60 s.

2.5 seconds of the start. In aggregate (Figure 11a, right), Polymorph improves on EEVDF by 2.75×, compared with 2.27× for the best single policy, Wake-boost, and 0.68× for sched_ext’s default policy. The agentic offline policy reaches 3.23×, mostly on the seen workloads (3.95× against 3.08× for Polymorph): it classifies each task by what woke it, which cuts p99 latency on OLTP + batch to less than half of Polymorph’s, and on CPU-bound it raises batch throughput by nearly stopping the threads that compute briefly and sleep, which the metric does not count. Its search used 3.1M tokens; a fresh agent regenerated Polymorph’s policy and tuner from one prompt with 1.2M. Takeaway 4: Polymorph’s scheduler adapts one sched_ext policy to each workload and stays close to the best fixed policy on each. A bespoke offline policy does better on its training workloads, partly by starving unmeasured work. 6.2.2

Offline and Online Search with Unseen Workloads

On the two unseen workloads, Polymorph also matches the best sched_ext policy within one standard deviation (Figure 11a), although all sched_ext policies are within one standard deviation of each other there, so these runs show no harm rather than a choice among very different policies. The agentic offline policy loses its lead here, at 2.16× against 2.19× for Polymorph. Figure 11b shows the changing run. Polymorph changes its setting at most once per stage, within 2.5 seconds of each change. Over the OLTP + batch stage, its p99 latency is 3.9× below EEVDF, while Long-slice, the setting the policy starts in, lets p99 latency grow to seconds. On the unseen stages, Polymorph switches to Per-socket while Silo loads its database, before Silo serves requests, and keeps it; its p99 latency stays 3.2× and 2.1× below EEVDF, about the same as with Long-slice. Takeaway 5: Polymorph’s scheduler handles workloads it never saw without harm, and follows a changing workload within one 2-second window.

7

R ELATED W ORK

Configuration tuning: Tuners search the parameters that existing policies expose, using Bayesian optimization, reinforcement learning, or LLMs (Alipourfard et al., 2017; Van Aken et al., 2017; Curino et al., 2020; Somashekar et al., 2024; Chen et al., 2024), including TuxBot (Liargkovas et al., 2026) (§4.3). They can only choose among behaviors that a policy already implements. Polymorph writes the policy itself, and its parameters remain open to such tuners. LLM-driven policy generation: AlphaEvolve-style frameworks such as OpenEvolve and ADRS search over programs offline against an evaluator (Novikov et al., 2025; Sharma, 2025; Cheng et al., 2025) (§4.1), and Vulcan synthesizes instance-specialized heuristics but keeps each one fixed at runtime (Dwivedula et al., 2027). Kgent and SchedCP use agents to synthesize eBPF programs and sched_ext schedulers (Zheng et al., 2024; 2025). Unlike these, Polymorph calls an agent only once and adapts the resulting cache_ext (Zussman et al., 2025) or sched_ext policy online, without an LLM in the loop. Adaptive OS kernel policies: Classic cache policies adapt to the workload (Megiddo & Modha, 2003; Vietri et al., 2018; Rodriguez et al., 2021; Beckmann et al., 2018; Yang et al., 2023), and LinnOS and LAKE bring learned models into kernel decisions (Hao et al., 2020; Fingler et al., 2023). Closest to Polymorph, S4-FIFO separates a simple cache data path from parameter selection, but selects parameters with a model trained offline (Xia et al., 2026), whereas Polymorph searches for them online from measured performance.

8

C ONCLUSION

Polymorph customizes OS policies online by pairing a generalized eBPF kernel policy with a user mode tuner that adjusts its parameters while the workload runs, with no LLM in the loop. Policies that LLM-based evolutionary search or agentic iteration generate offline are competitive on the data they were generated from, but lose much of their performance on unseen data. For the page cache, on

Polymorph: Operating System Kernel Optimization through Artificial Intelligence

data that no approach saw during generation, Polymorph improves throughput over Linux’s LRU by 8.4%, nearly twice the gain of the best cache_ext policy, at a one-time cost of 16M tokens. For the process scheduler, it improves on EEVDF by 2.75× across six workloads and follows workload changes within 2.5 seconds. In the cases we evaluated, AI alone did not produce the best policies; the most value came from combining a novel policy design with AI that builds and tunes it.

9

ACKNOWLEDGMENTS

This work was supported by IBM. We thank the CloudLab team for their assistance. Tal Zussman was supported by NSF award DGE-2036197 and a Google PhD fellowship. Georgios Liargkovas was support by Sony.

R EFERENCES Alipourfard, O., Liu, H. H., Chen, J., Venkataraman, S., Yu, M., and Zhang, M. Cherrypick: Adaptively unearthing the best cloud configurations for big data analytics. In 14th USENIX Symposium on Networked Systems Design and Implementation (NSDI 17), pp. 469–482, 2017. Beckmann, N., Chen, H., and Cidon, A. LHD: Improving cache hit rate by maximizing hit density. In 15th USENIX Symposium on Networked Systems Design and Implementation (NSDI 18), pp. 389–403, Renton, WA, April 2018. USENIX Association. ISBN 978-1-939133-01-4. URL https://www.usenix.org/conference/ nsdi18/presentation/beckmann. Cao, X., Patel, S., Lim, S. Y., Han, X., and Pasquier, T. FetchBPF: Customizable prefetching policies in linux with eBPF. In 2024 USENIX Annual Technical Conference (USENIX ATC 24), pp. 369–378, Santa Clara, CA, July 2024. USENIX Association. ISBN 978-1939133-41-0. URL https://www.usenix.org/ conference/atc24/presentation/cao. Chen, H., Wen, Y., Cheng, L., Kuang, S., Liu, Y., Li, W., Li, L., Zhang, R., Song, X., Li, W., et al. Autoos: make your os more powerful by exploiting large language models. In Forty-first International Conference on Machine Learning, 2024. Chen, Z., Zhang, W., Tang, Y., Shu, R., Ren, F., Xu, T., and Liu, J. Xkernel: Principled performance tunability of operating system kernels. In 20th USENIX Symposium on Operating Systems Design and Implementation (OSDI 26), pp. 547–565. USENIX Association, 2026. URL https://www.usenix.org/conference/ osdi26/presentation/chen-zhongjie. Cheng, A., Liu, S., Pan, M., Li, Z., Wang, B., Krentsel, A.,

Xia, T., Cemri, M., Park, J., Yang, S., et al. Barbarians at the gate: How ai is upending systems research. arXiv preprint arXiv:2510.06189, 2025. Curino, C., Godwal, N., Kroth, B., Kuryata, S., Lapinski, G., Liu, S., Oks, S., Poppe, O., Smiechowski, A., Thayer, E., et al. Mlos: An infrastructure for automated software performance engineering. In Proceedings of the Fourth International Workshop on Data Management for End-toEnd Machine Learning, pp. 1–5, 2020. Duplyakin, D., Ricci, R., Maricq, A., Wong, G., Duerig, J., Eide, E., Stoller, L., Hibler, M., Johnson, D., Webb, K., Akella, A., Wang, K., Ricart, G., Landweber, L., Elliott, C., Zink, M., Cecchet, E., Kar, S., and Mishra, P. The design and operation of CloudLab. In 2019 USENIX Annual Technical Conference (USENIX ATC 19), pp. 1–14, Renton, WA, July 2019. USENIX Association. ISBN 978-1-939133-03-8. URL https://www.usenix.org/conference/ atc19/presentation/duplyakin. Dwivedula, R., Saxena, D., Akella, A., Chaudhuri, S., and Kim, D. Man-made heuristics are dead. long live code generators! In Proceedings of the 24th ACM Workshop on Hot Topics in Networks, HotNets ’25, pp. 51–60, New York, NY, USA, 2025. Association for Computing Machinery. ISBN 9798400722806. doi: 10.1145/3772356.3772413. URL https://doi. org/10.1145/3772356.3772413. Dwivedula, R., Saxena, D., Yadalam, S., Campbell, E. H., Kim, D., and Akella, A. Vulcan: Instance-specialized, verifiable systems heuristics through LLM-driven search. In Proceedings of the 22nd European Conference on Computer Systems, EuroSys ’27, New York, NY, USA, 2027. Association for Computing Machinery. doi: 10.1145/ 3842654.3848582. Fingler, H., Tarte, I., Yu, H., Szekely, A., Hu, B., Akella, A., and Rossbach, C. J. Towards a machine learningassisted kernel with lake. In Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2, pp. 846–861, 2023. Hao, M., Toksoz, L., Li, N., Halim, E. E., Hoffmann, H., and Gunawi, H. S. Linnos: Predictability on unpredictable flash storage with a light neural network. In 14th USENIX Symposium on Operating Systems Design and Implementation (OSDI 20), pp. 173–190, 2020. Hodges, D. Scheduling at scale: eBPF schedulers with sched_ext. Dublin, October 2024. USENIX Association. Humphries, J. T., Natu, N., Chaugule, A., Weisse, O., Rhoden, B., Don, J., Rizzo, L., Rombakh, O., Turner,

Polymorph: Operating System Kernel Optimization through Artificial Intelligence

P., and Kozyrakis, C. GhOSt: Fast & flexible userspace delegation of Linux scheduling. In Proceedings of the ACM SIGOPS 28th Symposium on Operating Systems Principles, SOSP ’21, pp. 588–604, New York, NY, USA, 2021. Association for Computing Machinery. ISBN 9781450387095. doi: 10.1145/ 3477132.3483542. URL https://doi.org/10. 1145/3477132.3483542. Kaffes, K., Humphries, J. T., Mazières, D., and Kozyrakis, C. Syrup: User-defined scheduling across the stack. In Proceedings of the ACM SIGOPS 28th Symposium on Operating Systems Principles, SOSP ’21, pp. 605–620, New York, NY, USA, 2021. Association for Computing Machinery. ISBN 9781450387095. doi: 10.1145/ 3477132.3483548. URL https://doi.org/10. 1145/3477132.3483548.

Liargkovas, G., Joshi, M. N., Franke, H., and Kaffes, K. Tuxbot: Semantic-aware online os tuning with llms. In Proceedings of the ACM SIGOPS 32nd Symposium on Operating Systems Principles, pp. 580–599, 2026. Linux Kernel Development Community. eBPF Verifier Documentation. Linux Kernel Organization, kernel documentation edition, 2026. URL https://docs.kernel. org/bpf/verifier.html. Accessed: November 19, 2026.

Karedla, R., Love, J., and Wherry, B. Caching strategies to improve disk system performance. Computer, 27(3): 38–46, 1994. doi: 10.1109/2.268884.

Liu, S., Cemri, M., Agarwal, S., Krentsel, A., Naren, A., Mang, Q., Li, Z., Gupta, A., Maheswaran, M., Cheng, A., Pan, M., Boneh, E., Ramchandran, K., Sen, K., Zaharia, M., Dimakis, A. G., and Stoica, I. Skydiscover: A flexible, adaptive framework for ai-driven scientific and algorithmic discovery. In Proceedings of the ACM Conference on AI and Agentic Systems, CAIS ’26, pp. 1223–1227. Association for Computing Machinery, 2026. doi: 10.1145/3786335.3813221. URL https: //doi.org/10.1145/3786335.3813221.

Karthikeyan, A., Natarajan, N., Somashekar, G., Zhao, L., Bhagwan, R., Fonseca, R., Racheva, T., and Bansal, Y. {SelfTune}: Tuning cluster managers. In 20th USENIX Symposium on Networked Systems Design and Implementation (NSDI 23), pp. 1097–1114, 2023.

Maas, M., Hashemi, M., McKinley, K., and Ranganathan, P. Ai for systems is "agi-complete". SIGOPS Oper. Syst. Rev., 60(1):21–29, July 2026. ISSN 0163-5980. doi: 10. 1145/3830422.3830425. URL https://doi.org/ 10.1145/3830422.3830425.

Kasture, H. and Sanchez, D. Tailbench: a benchmark suite and evaluation methodology for latency-critical applications. In 2016 IEEE International Symposium on Workload Characterization (IISWC), pp. 1–10. IEEE, 2016.

Megiddo, N. and Modha, D. S. ARC: A self-tuning, low overhead replacement cache. In Proceedings of the 2nd USENIX Conference on File and Storage Technologies (FAST ’03), pp. 115–130, 2003. URL https: //www.usenix.org/conference/fast-03/ arc-self-tuning-low-overhead-replace ment-cache.

Kopytov, A. sysbench: Scriptable database and system performance benchmark. https://github.com/ akopytov/sysbench/releases/tag/1.0.20, 2020. Version 1.0.20. Lao, J., Wang, Y., Li, Y., Wang, J., Zhang, Y., Cheng, Z., Chen, W., Tang, M., and Wang, J. Gptuner: A manualreading database tuning system via gpt-guided bayesian optimization. Proceedings of the VLDB Endowment, 17 (8):1939–1952, 2024. doi: 10.14778/3659437.3659449. Lee, D., Choi, I., Lee, C., Jung, H., and Kim, J. P2cache: Enhancing data-centric applications via application-guided management of os page caches. ACM Trans. Storage, 22(1), January 2026. ISSN 1553-3077. doi: 10.1145/3736586. URL https://doi.org/10. 1145/3736586. Liargkovas, G., Jabrayilov, V., Franke, H., and Kaffes, K. An expert in residence: LLM agents for always-on operating system tuning. In Machine Learning for Systems 2025, 2025. URL https://openreview.net/forum? id=7dhlgPp8ni.

Meta Platforms, I. Evaluating SSD hardware for Facebook workloads, 2026. URL https: //cachelib.org/docs/Cache_Library_ User_Guides/Cachebench_FB_HW_eval/. Novikov, A., Vũ, N., Eisenberger, M., Dupont, E., Huang, P.-S., Wagner, A. Z., Shirobokov, S., Kozlovskii, B., Ruiz, F. J. R., Mehrabian, A., Kumar, M. P., See, A., Chaudhuri, S., Holland, G., Davies, A., Nowozin, S., Kohli, P., and Balog, M. AlphaEvolve: A coding agent for scientific and algorithmic discovery, 2025. URL https://arxiv. org/abs/2506.13131. Qin, Y., Virmani, A., Bolat, S., Chaudhary, A., Ul Hasan, N. T., Zheng, M., Angel, S., Rossbach, C. J., and Swift, M. M. Operating system policies in the wild. In Proceedings of the 2026 ACM SIGOPS Annual Technical Conference, SIGOPS ATC ’26, New York, NY, USA, 2026. Association for Computing Machinery. doi: 10.1145/3828523.3857040.

Polymorph: Operating System Kernel Optimization through Artificial Intelligence

Rodriguez, L. V., Yusuf, F., Lyons, S., Paz, E., Rangaswami, R., Liu, J., Zhao, M., and Narasimhan, G. Learning cache replacement with CACHEUS. In 19th USENIX Conference on File and Storage Technologies (FAST 21), pp. 341–354. USENIX Association, February 2021. ISBN 978-1-939133-20-5. URL https://www.usenix.org/conference/ fast21/presentation/rodriguez. Sharma, A. Openevolve: an open-source evolutionary coding agent, 2025. URL https://github. com/algorithmicsuperintelligence/ openevolve. Somashekar, G., Tandon, K., Kini, A., Chang, C.-C., Husak, P., Bhagwan, R., Das, M., Gandhi, A., and Natarajan, N. Oppertune: Post-deployment configuration tuning of services made easy. In 21st USENIX Symposium on Networked Systems Design and Implementation (NSDI 24), pp. 1101–1120, 2024. Van Aken, D., Pavlo, A., Gordon, G. J., and Zhang, B. Automatic database management system tuning through large-scale machine learning. In Proceedings of the 2017 ACM international conference on management of data, pp. 1009–1024, 2017. Vietri, G., Rodriguez, L. V., Martinez, W. A., Lyons, S., Liu, J., Rangaswami, R., Zhao, M., and Narasimhan, G. Driving cache replacement with ML-based LeCaR. In 10th USENIX Workshop on Hot Topics in Storage and File Systems (HotStorage 18), Boston, MA, July 2018. USENIX Association. URL https://www.usenix.org/conference/ hotstorage18/presentation/vietri. Wang, S., Li, C., Hoffmann, H., Lu, S., Sentosa, W., and Kistijantoro, A. I. Understanding and auto-adjusting performance-sensitive configurations. In Proceedings of the Twenty-Third International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS ’18, pp. 154–168, New York, NY, USA, 2018. Association for Computing Machinery. ISBN 9781450349116. doi: 10.1145/ 3173162.3173206. URL https://doi.org/10. 1145/3173162.3173206.

14th USENIX Symposium on Operating Systems Design and Implementation (OSDI 20), pp. 191–208. USENIX Association, November 2020. ISBN 978-1-939133-19-9. URL https://www.usenix.org/conference/ osdi20/presentation/yang. Yang, J., Yue, Y., Vinayak, R., Zhang, Y., and Qiu, Z. FIFO queues are all you need for cache eviction. In Proceedings of the 29th ACM Symposium on Operating Systems Principles (SOSP ’23), pp. 130–149, 2023. doi: 10.1145/3600006.3613147. URL https://dl.acm. org/doi/10.1145/3600006.3613147. Zheng, Y., Yang, Y., Chen, M., and Quinn, A. Kgent: Kernel extensions large language model agent. In Proceedings of the ACM SIGCOMM 2024 Workshop on EBPF and Kernel Extensions, eBPF ’24, pp. 30–36, New York, NY, USA, 2024. Association for Computing Machinery. ISBN 9798400707124. doi: 10.1145/ 3672197.3673434. URL https://doi.org/10. 1145/3672197.3673434. Zheng, Y., Hu, Y., Zhang, W., and Quinn, A. Towards agentic os: An llm agent framework for linux schedulers. arXiv preprint arXiv:2509.01245, 2025. Zhong, Y., Li, H., Wu, Y. J., Zarkadas, I., Tao, J., Mesterhazy, E., Makris, M., Yang, J., Tai, A., Stutsman, R., and Cidon, A. XRP: In-Kernel storage functions with eBPF. In 16th USENIX Symposium on Operating Systems Design and Implementation (OSDI 22), pp. 375–393, Carlsbad, CA, July 2022. USENIX Association. ISBN 9781-939133-28-1. URL https://www.usenix.org/ conference/osdi22/presentation/zhong. Zussman, T., Zarkadas, I., Carin, J., Cheng, A., Franke, H., Pfefferle, J., and Cidon, A. cache_ext: Customizing the page cache with eBPF. In Proceedings of the ACM SIGOPS 31st Symposium on Operating Systems Principles, SOSP ’25, pp. 462–478, New York, NY, USA, 2025. Association for Computing Machinery. ISBN 9798400718700. doi: 10.1145/ 3731569.3764820. URL https://doi.org/10. 1145/3731569.3764820.

Xia, C., Yang, J., Yue, Y., Vinayak, R., and Cidon, A. Learning-augmented heuristics: Simple yet smart, robust and interpretable cache eviction. In Proceedings of the 14th USENIX Symposium on Operating Systems Design and Implementation (OSDI ’26), 2026. URL https://www.usenix.org/conference/ osdi26/presentation/xia.

Zussman, T., Dey, R., Zengin, H., Fang, Y., Hildenbrand, D., and Cidon, A. It’s the kernel’s fault! custom page fault handling with bpf_fault. In Proceedings of the ACM SIGOPS 32nd Symposium on Operating Systems Principles, SOSP ’26, pp. 448–464, New York, NY, USA, 2026a. Association for Computing Machinery. ISBN 9798400725852. doi: 10. 1145/3830418.3843896. URL https://doi.org/ 10.1145/3830418.3843896.

Yang, J., Yue, Y., and Rashmi, K. V. A large scale analysis of hundreds of in-memory cache clusters at Twitter. In

Zussman, T., Zarkadas, I., Carin, J., Cheng, A., Franke, H., Pfefferle, J., and Cidon, A. cache_ext: Customiz-

Polymorph: Operating System Kernel Optimization through Artificial Intelligence

ing and tracing the page cache with eBPF. ACM Trans. Comput. Syst., June 2026b. ISSN 0734-2071. doi: 10.1145/3819062. URL https://doi.org/10. 1145/3819062. Just Accepted.

AI U SAGE D ISCLOSURE Generative AI assistants were used to assist with writing and plot generation, among them Claude, Gemini, and ChatGPT. For writing, this assistance focused on improving style and condensing text, including refining wording and making explanations more concise. For plot generation, AI assistance was used to help develop and refine plotting code and adjust the visual presentation of results.

Polymorph: Operating System Kernel Optimization through Artificial Intelligence

A

S CHEDULER P OLICY AND T UNER

Figure 12 shows the scheduler policy and tuner evaluated in §6.2. Polymorph

ONLINE

Application

3

Tuner picks one of three settings

Monitor perf stat every 2 s

4

1

user kernel

2

params map

perf counters

5

sched_ext policy wakeup skips ahead

Threads

CPUs shared or per-socket queue

run for a slice

1 Figure 12. Polymorph’s scheduler. The application’s threads ⃝ wait in the sched_ext policy’s run queue. A thread that wakes up skips ahead of threads that have waited less than the wake boost (0 or 16 ms, depending on the setting). Every 2 s, the monitor reads 2 and the tuner picks three perf counters on the workload’s CPUs ⃝, 3 and writes it into the params map ⃝, 4 which the policy a setting ⃝ 5 reads at its next decision ⃝.

Policy. The policy is a sched_ext policy with four parameters, kept in a one-entry eBPF array map (Table 3). Each scheduling callback reads the map, so a new setting takes effect at the next scheduling decision, without reloading the policy. When a task wakes up and the kernel’s default CPU selection finds an idle CPU, the policy places the task directly on that CPU. Otherwise, the task enters a run queue: either one queue shared by all CPUs, or the queue of the socket its CPU belongs to. Each queue is ordered by enqueue time, and a woken task’s time is moved earlier by the wake boost. A woken task can therefore pass at most that much waiting work, and no task waits forever. A CPU that needs work takes the first task in its queue. With per-socket queues, it takes a task from another socket’s queue when its own is empty. After a change of queue scope, CPUs first drain the queues of the old scope, so no task is left in a queue that is no longer used. The policy keeps separate slices for woken and other tasks, but all three settings use the same value for both. Invalid values fall back to the sched_ext default (one shared queue, no boost, 20 ms slices). Table 3. Parameters of the scheduler policy and their values in the three settings the tuner chooses from. Parameter

Long-slice

Wake-boost

Per-socket

Queue scope Wake boost Time slice Idle placement

shared 0 20 ms on

shared 16 ms 5 ms on

per socket 0 5 ms on

Tuner. Every 2 seconds, the tuner reads three counters with perf stat on the workload’s 11 CPUs: the sched:sched_wakeup tracepoint, which counts task

wakeups; ref-cycles, which counts reference cycles and stops while a CPU is idle; and msr/tsc/, which counts time-stamp counter cycles and does not stop. From these it computes two statistics: • busy CPUs b = 11 × ref-cycles/tsc; • CPU time per wakeup t = b/w, where w is the number of wakeups per second. It then applies three rules: 1. If b < 2, the window is a gap between workloads, and the tuner keeps the current setting. 2. The CPUs are saturated when b/11 ≥ 0.99. Once saturated, they remain so until b/11 < 0.95. 3. If the CPUs are saturated and t ≥ 400 µs, the tuner selects Long-slice. If they are saturated and t < 400 µs, it selects Wake-boost. Otherwise, it selects Per-socket. Long bursts on saturated CPUs indicate CPU-bound work, which runs best with long slices. Short bursts on saturated CPUs indicate request threads competing with other work, so woken requests should pass the queue. When there is spare capacity, per-socket queues keep tasks on their socket. The thresholds come from runs of the four seen workloads. The tuner writes to the map only when the setting changes, and it never reads the application’s latency or throughput.

Related documents

Record · ID 1702544 · SHA-256 5436cc5ef6c47501
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive