Serverless cloud platforms typically rely on operating-system schedulers such as the Completely Fair Scheduler (CFS) and Earliest Eligible Virtual Deadline First (EEVDF) to schedule function executions across CPU cores. Prior work has shown that existing schedulers either minimize task latency at the expense of runtime efficiency or improve runtime efficiency while increasing latency. Although hybrid approaches partially mitigate this trade-off, each scheduler remains confined to a narrow region of the latency-runtime trade-off space, leaving much of the design space unexplored. We present a class of synthesized schedulers that expose configurable latency-runtime trade-offs. Rather than hand-designing heuristics, we use reinforcement learning to synthesize policies for core assignment, preemption, and load balancing under different reward objectives. We implement the synthesized schedulers using Linux sched_ext, train them on representative serverless workloads, and evaluate them on a multi-core server. Synthesized schedulers are competitive with both general-purpose Linux schedulers (CFS, EEVDF, and FIFO) and state-of-the-art serverless-aware schedulers. More importantly, they can be tuned at deployment time to span a near-continuous set of latency-runtime operating points. Several of these operating points reduce both latency and runtime cost, improving profitability for both cloud users and providers.
Figures & tables
Figure 1. Latency–runtime trade-off. Accumulated task latency and accumulated task runtime across a workload extracted from Microsoft Azure trace. CFS and EEVDF achieve low latency with high runtime, while FIFO reduces runtime at the cost of higher latency. Our synthesized schedulers trace out an empirical Pareto frontier.
Figure 2. CDFs of response latency and runtime distributions with a workload under Round Robin, Preemption, Work shuffling on 50 CPU cores.
Mechanisms
Time to Complete 99% of Tasks (s)
Round-Robin
388
Preemption
294
Work Shuffling
268
Preempt+Shuffle
254
Table 1. Comparison of the time required to complete 99% of the tasks under four scheduling mechanisms.
State Space
Number of started tasks, number of unstarted tasks, number of finished tasks, per-core queue lengths, accumulated latency, accumulated runtime, accumulated preemption count
Action Space
Destination CPU core for incoming invocations (50 choices DDQN ( Wang et al., 2016 ) ), preemption time slice (5 choices, DQN ( Mnih et al., 2013 ) ), destination CPU cores for rebalanced tasks (50 choices, DDQN ( Wang et al., 2016 ) )
Table 2. State and action spaces of the RL agent (in parentheses, the number of discrete choices for each action).
Figure 3. Architecture of synthesized schedulers. The high-frequency controller batches arriving tasks and assigns them to per-core queues every 20 ms. The low-frequency controller adjusts the preemption time slice and performs load rebalancing every 500 ms.
Figure 4. Reward and accumulated runtime over 50 training episodes, with 95% confidence bands across five random seeds. Both stabilize within 50 episodes, indicating convergence.
Figure 5. Synthesized scheduler communication pattern: the sched_ext Rust+BPF backend (left) publishes a state snapshot of runtime metrics to the Python RL agent (right); the Q/Dueling-DQN agent returns target-core and time-slice decisions, which the backend applies as core placement and time-slice control.
Workload
Period
Invocations
Generalization
Training
Day01, midnight
8,285
–
Workload 1
Day02, midnight
8,627
day-to-day
Workload 2
Day01, noon
9,463
time-of-day
Workload 3
Day10, evening
18,155
time-of-day & day-to-day
Workload 4
Day02, midnight
8,627
heterogeneous
Workload 5
Day01, noon
9,463
heterogeneous
Table 3. Summary of training and test workloads.
Figure 6. CDFs of response latency for a workload extracted from the Microsoft Azure trace under CFS, EEVDF, FIFO, Hybrid ( Zhao et al., 2024 ) , ALPS ( Fu et al., 2024 ) , SFS ( Fu et al., 2022 ) , and three synthesized scheduling policies on 50 CPU cores. Synthesized Latency closely tracks the low-latency schedulers (CFS, EEVDF, ALPS), showing it stays in its target region on an unseen workload.
Figure 7. Task runtime distributions for a workload extracted from the Microsoft Azure trace under CFS, EEVDF, FIFO, Hybrid ( Zhao et al., 2024 ) , ALPS ( Fu et al., 2024 ) , SFS ( Fu et al., 2022 ) , and three synthesized scheduling policies on 50 CPU cores. Synthesized Runtime overlaps FIFO, the practical runtime lower bound.
Policy
Latency (s)
Runtime (s)
Cost
Workload 4
Low-latency region
CFS
173 ± 2
209,279 ± 2,247
1.0000
EEVDF
168 ± 0.4
212,022 ± 889
1.0132 ± 0.0104
ALPS
567 ± 6
204,328 ± 1,594
0.9765 ± 0.0156
Synthesized Latency
14,524 ± 668
308,601 ± 11,137
1.4748 ± 0.0592
Table 4. Performance comparison on heterogeneous workloads (Workload 4–6). Latency and runtime are accumulated values across all tasks. Cost is normalized to CFS within each workload. Lower is better for all metrics. Each synthesized policy holds its target operating region. Values are mean ± standard deviation over 5 independent runs.
Policy
0–120s
0–240s
Tail > 240s
T99%
CFS
69.3%
89.2%
10.8%
359.2s
EEVDF
69.2%
89.4%
10.6%
361.5s
FIFO
33.3%
66.0%
34.0%
358.5s
Hybrid
48.6%
88.7%
11.3%
422.1s
ALPS
69.7%
89.8%
10.2%
352.1s
SFS
36.5%
67.8%
32.2%
351.9s
Table 5. Function completion timing across scheduling policies (0–120s / 0–240s: share completed within each window; Tail > 240s: share finishing after 240s; T99% : time to complete 99%). Synthesized policies stay comparable to the baselines on completion throughput.
Comm
RL inference
Total
Scheduling overhead per task ( μ s)
0.67
134.50
135.17
Share of whole workload (%)
0.002
0.40
0.40
Table 6. Per-task scheduling overhead of the synthesized schedulers, split into scheduler–agent communication and RL inference. Overhead of μ s scale is sufficiently small for serverless scheduling decisions.
Metric
Comm
RL inference
Total
CPU core assignment request
1.00
2.57
2.57
Preemption time-slice update
1.00
2.98
2.98
Scheduling overhead per task
1.00
2.57
2.57
Table 7. GPU/CPU overhead ratio for scheduler decision paths on an NVIDIA A30. Values larger than one indicate that GPU execution is slower, so no accelerator is needed for online inference.
Figure 8. Latency–cost trade-off. CFS, EEVDF, and ALPS ( Fu et al., 2024 ) achieve low latency with high cost, while FIFO and SFS ( Fu et al., 2022 ) reduce cost but with higher latency. Hybrid ( Zhao et al., 2024 ) provides intermediate baseline. Our synthesized schedulers span the trade-off space.
Figure 9. Provider headroom versus client cost improvement, both relative to CFS. Synthesized schedulers can increase profit both for provider and client, depending on latency.
Figure 10. Wait-time fairness and mean task latency across heuristic and synthesized schedulers according to the Gini coefficient. The synthesized schedulers offer similar fairness to existing schedulers.
Real-time schedulers must reason about tight deadlines under strict compute budgets. We present TempoNet, a reinforcement learning scheduler that pairs a permutation-invariant Transformer with a deep Q-approximation. An Urgency Tokenizer discretizes temporal slack into learnable embeddings, stabilizing value learning and capturing deadline proximity. A latency-aware sparse attention stack with blockwise top-k selection and locality-sensitive chunking enables global reasoning over unordered task sets with near-linear scaling and sub-millisecond inference. A multicore mapping layer converts contextualized Q-scores into processor assignments through masked-greedy selection or differentiable matching. Extensive evaluations on industrial mixed-criticality traces and large multiprocessor settings show consistent gains in deadline fulfillment over analytic schedulers and neural baselines, together with improved optimization stability. Diagnostics include sensitivity analyses for slack quantization, attention-driven policy interpretation, hardware-in-the-loop and kernel micro-benchmarks, and robustness under stress with simple runtime mitigations; we also report sample-efficiency benefits from behavioral-cloning pretraining and compatibility with an actor-critic variant without altering the inference pipeline. These results establish a practical framework for Transformer-based decision making in high-throughput real-time scheduling.
Modern operating system process schedulers typically enforce a static, ``one-policy-fits-all'' design, which inevitably compromises performance under the highly dynamic and mixed workloads of contemporary edge systems. Transitioning to dynamic adaptation faces two fundamental challenges: scenario specific static policies lack robust runtime adaptability, whereas computationally intensive AI-assisted policies introduce unacceptable execution overhead for resource-constrained devices. To structurally resolve this dilemma, we propose the Lightweight Adaptive Policy Switcher (LAPS), a framework that dynamically switches between predefined expert policies, thus decoupling high frequency context switching from low-frequency policy transitions and amortizing transitional overheads. To eliminate prohibitive online computations, LAPS pre-resolves all heavy dynamic tradeoffs via an offline preparation phase, constructing a strictly overhead-aware Policy Mapping Table. During runtime, it executes an agentic Observe-Infer-Switch cycle that limits machine learning inference strictly to workload classification. Consequently, LAPS executes efficient dynamic adaptation simply by mapping the inferred workload state to optimal expert policies via low-cost table lookups. Experiments show that LAPS achieves an average performance gain of 8.91% and reduces response latency by up to 91.7% in latency-sensitive tasks over the default Linux scheduler EEVDF. Our results demonstrate that LAPS outperforms the baseline in a wide range of test cases, offering a practical path toward more responsive and intelligent operating systems. Our code is publicly available at https://github.com/lvmiao233/LAPS.
Xinbo Wang, Shian Jia, Ziyang Huang +2
Zhejiang University Hangzhou, Zhejiang, China · HangZhou City University Hangzhou, Zhejiang, China
Serverless computing simplifies cloud deployment but introduces new challenges in managing service latency and carbon emissions. Reducing cold-start latency requires retaining warm function instances, while minimizing carbon emissions favors reclaiming idle resources. This balance is further complicated by time-varying grid carbon intensity and varying workload patterns, under which static keep-alive policies are inefficient. We present LACE-RL, a latency-aware and carbon-efficient management framework that formulates serverless pod retention as a sequential decision problem. LACE-RL uses deep reinforcement learning to dynamically tune keep-alive durations, jointly modeling cold-start probability, function-specific latency costs, and real-time carbon intensity. Using the Huawei Public Cloud Trace, we show that LACE-RL reduces cold starts by 51.69% and idle keep-alive carbon emissions by 77.08% compared to Huawei's static policy, while achieving better latency-carbon trade-offs than state-of-the-art heuristic and single-objective baselines, approaching Oracle performance.
Bowen Sun, Christos D. Antonopoulos, Evgenia Smirni +3
Department of Computer Science, William & Mary, Williamsburg, VA, USA · Department of Computer Science, University of Thessaly, Volos, Greece