Expanding Linux Core Scheduling for L2 Cache Isolation
AWS has introduced kernel patches to expand core scheduling beyond SMT siblings, aiming to isolate tasks sharing L2 cache resources to prevent side-channel leakage.
TL;DR
- AWS engineer Ahmed Abdelraoof has proposed patches to expand Linux core scheduling beyond SMT siblings.
- The proposal introduces "cluster unit" isolation, specifically targeting CPUs sharing an L2 cache.
- This mitigates concurrent cache-based side-channel attacks like Prime+Probe where SMT is either absent or insufficient.
- The implementation uses "cookie" based co-residency to ensure untrusted tasks do not share cache domains.
- Frequency-domain side channels remain outside the scope of this initial patch series.
The Linux kernel's approach to task isolation has historically focused on the Simultaneous Multi-Threading (SMT) boundary. By ensuring that "distrusting" tasks—those belonging to different security domains or tenants—never occupy the same physical core simultaneously, the kernel successfully mitigates a broad class of microarchitectural side-channel attacks. However, as CPU topologies evolve, the traditional SMT-centric model is increasingly viewed as an incomplete solution. Modern processor designs frequently employ shared resource structures that extend beyond the physical core, most notably in the form of shared Level 2 (L2) caches.
According to reports, AWS engineer Ahmed Abdelraoof has proposed a series of kernel patches that generalise Linux core scheduling to account for these cache-heavy architectures. By shifting the definition of an "isolation unit" from just SMT siblings to broader "cluster units," the kernel can now enforce security boundaries across cores sharing a common L2 cache. This shift is essential for high-density, multi-tenant environments where attackers and victims might reside on different cores but share underlying hardware resources that allow for information leakage.
The Evolution of Core Scheduling
The original implementation of core scheduling in the Linux kernel was a pragmatic response to the reality of Hyper-Threading (Intel) and SMT (AMD). By binding tasks to "cookies," the scheduler ensures that a thread with a specific security context only executes on a core when its sibling thread also shares that same context. If no suitable task is available to fill the sibling slot, the kernel forces the sibling into an idle state rather than permitting a lower-trust task to execute.
This model assumed that the primary point of contention—and therefore the primary vector for exploitation—was the physical core itself. However, modern microarchitectures are increasingly "cluster-based." In these designs, two or more physical cores may share an L2 cache, even if SMT is disabled or if the cores are physically distinct. In such scenarios, the SMT sibling set reduces to a single CPU, rendering traditional core scheduling ineffective against cache-based leaks. The new proposal acknowledges this change by redefining the isolation unit, allowing the scheduler to treat these L2-sharing clusters as the primary boundary for security-sensitive scheduling decisions.
The L2 Cache Side-Channel Threat
Shared L2 caches provide a high-bandwidth, low-latency medium for side-channel exploitation. In a typical Prime+Probe scenario, an attacker process executes a sequence of memory accesses to "prime" specific cache sets. By observing the time it takes to subsequently "probe" (re-access) those same sets, the attacker can infer which memory lines have been evicted by a victim process executing concurrently on a core that shares the same cache hierarchy.
The proposed kernel changes specifically address concurrent execution. If an attacker and a victim operate within the same cluster unit, they can modulate cache state in a way that allows the attacker to extract sensitive information. By enforcing "same-cookie co-residency" across these clusters, the kernel effectively isolates potential adversaries at the cache level. It is important to note that this mechanism does not defend against attacks that span context switches—such as those occurring when a victim is descheduled and an attacker is subsequently scheduled on the same hardware—as those are addressed by existing kernel flushing and sanitisation routines.
Topological Isolation: Beyond SMT
The proposed technical implementation generalises the core scheduling framework. Instead of hard-coding the isolation unit to the SMT sibling set, the patch introduces a configurable unit definition. On x86 architectures, the kernel identifies these "cluster units" by traversing the CPU topology to find sets of processors that share an L2 cache.
The logic is as follows:
- The scheduler maintains a set of CPUs defined as a "cluster unit" based on the system topology.
- When selecting tasks for execution, the scheduler checks the "cookie" assigned to the task.
- The scheduler prevents the concurrent execution of tasks with incompatible cookies across all cores within the same cluster unit.
This ensures that if a task is marked as sensitive, the scheduler will avoid placing a task from a different, untrusted context on any core that shares the L2 cache with the current processor, regardless of whether those cores are SMT siblings.
Operational and Performance Implications
Engineering a kernel scheduler involves balancing security requirements against CPU utilisation and throughput. By expanding the isolation units, the scheduler loses flexibility. If an environment is heavily populated with "distrusting" tasks, the scheduler is forced to restrict which cores can run which processes, potentially leading to increased idle time or "CPU starvation" for certain task groups.
Performance Constraint
Expanding the isolation unit beyond SMT siblings significantly reduces the number of available CPU core selection options. Before deploying this in a production cluster, engineers should verify if their specific workload requires high-density co-residency, as this patch may increase scheduler latency and reduce overall throughput.
In multi-tenant cloud environments, this may necessitate a change in how orchestrators manage resource requests. Since the "cost" of isolation has increased—moving from the narrow SMT sibling set to a potentially wider cache cluster—the efficiency of packing containers or virtual machines onto a physical host may decrease. Assessing this overhead requires rigorous testing against existing baseline metrics to determine if the security gain justifies the potential drop in instructions per cycle (IPC) or overall task completion speed.
Frequency-Domain Channels: The Missing Piece
While the L2 cache is a critical vector, it is not the only microarchitectural resource that can be exploited. Frequency-domain channels involve one core's activity influencing the clock frequency of the entire cluster, creating a timing side-channel that does not rely on cache state at all. If one core is running a heavy cryptographic workload, the entire cluster might experience clock modulation, which an observer on another core in the same cluster could potentially measure.
The current patch series explicitly excludes these channels from its mitigation scope. This is a deliberate design choice, as frequency-domain mitigation often requires coordination with power management subsystems (such as Intel's Speed Shift or AMD's P-State drivers), which are far more complex to integrate into the scheduler's decision loop. Future development may eventually address this, but for now, the community should treat frequency-based side-channel protection as an outstanding risk.
Implementation Strategy for Engineers
For system maintainers and kernel engineers, the transition to cluster-aware scheduling necessitates a shift in visibility. You must first map your hardware topology to understand where the L2 boundaries lie. Tools like `lscpu` or examining `/sys/devices/system/cpu/cpu*/cache/` are starting points for determining your hardware's clustering.
To evaluate these patches:
# Check your current cache topology
cat /sys/devices/system/cpu/cpu0/cache/index2/shared_cpu_list
# Test in staging: monitor context switches and scheduler idle stats
# when applying your security-sensitive task policies.
perf stat -e sched:sched_switch,sched:sched_migrate_task -p
Maintainers should focus on identifying if their CPU topology exposes "L2-only" sharing that bypasses SMT isolation. If your hardware lacks SMT but shares L2 caches, this patch series becomes the primary software-level defence against cache-based information disclosure.
Key Takeaways
The movement from SMT-based isolation to cache-based isolation marks a transition in the kernel's defensive strategy. As CPU design becomes increasingly granular with shared resources, the definition of "isolation" must expand to match the topology. While this patch series provides a necessary hardening against concurrent Prime+Probe attacks, it represents only one step in a wider effort to isolate untrusted workloads.
Engineers should monitor the Linux kernel mailing list for updates on this proposal. Given the impact on scheduling policy, it is likely to undergo significant review regarding its performance overhead and interaction with power management. Understanding your own processor's cache topology is now as important as understanding its SMT capabilities when designing high-security infrastructure.
Frequently asked questions
How does this proposal differ from traditional SMT core scheduling?
Traditional core scheduling targets the SMT sibling relationship, preventing distrusting tasks from sharing a single physical core. The new proposal broadens this "isolation unit" to encompass entire cache clusters. By identifying groups of cores that share an L2 cache, the scheduler enforces cookie-based separation across these larger groups, mitigating side-channel risks in architectures where SMT might not be the primary leakage vector or may be disabled entirely.
Does this patch remove the need for SMT-level isolation?
No, it complements it. SMT-level isolation remains necessary for physical cores that share execution pipelines and microarchitectural buffers. The new proposal adds a secondary, wider layer of isolation that covers the L2 cache domain. You should continue to employ SMT-level core scheduling alongside this new cluster-aware logic to ensure that both core-level and cache-level side-channels are properly mitigated for untrusted workloads.
What impact will this have on existing high-performance computing clusters?
Expect a potential reduction in overall task scheduling efficiency. By increasing the constraints on where a task can run, the scheduler has fewer options to fill "idle" slots effectively. In high-density environments, you may observe increased latency or reduced throughput as the kernel prioritises cache security over raw performance. Rigorous benchmarking is recommended before enabling these features in production, especially for workloads that are sensitive to CPU scheduling jitter.
When can we expect this to arrive in stable Linux kernels?
The patch series is currently under review on the Linux kernel mailing list. As of late 2026, there is no confirmed timeline for merging. Kernel features of this nature—which fundamentally alter scheduler behaviour—typically undergo multiple revisions to address performance concerns and edge cases in CPU topology discovery. You should track the kernel mailing list progress to identify when it reaches a stable development branch or candidate release.
Related reading on ITSTCK
- Analysing the NixOS 26.11 Zokor Release for Infrastructure
- Raspberry Pi OS Shifts to Daily Images and Removes Browsers
- Managing AI-Driven Code Noise in the Linux Kernel
- FreeBSD 15.2-RC1: Transitioning to LLVM Linker and Cloud Refinement
Sources and further reading
This analysis was produced by the ITSTCK editorial pipeline with AI assistance, using only the public sources cited above, and passed automated checks for structure, sourcing and CVE accuracy. Verify critical details against the vendor advisory before acting.