Linux Kernel & OS

AWS patches Linux core scheduling to isolate tasks sharing an L2 cache

Key Takeaway

Amazon engineer Ahmed Abdelraoof proposes generalizing core scheduling from a hard-wired SMT sibling set to a configurable isolation unit, adding an x86 cluster unit that keeps distrusting tasks off cores sharing an L2 cache.

Summary

Amazon engineer Ahmed Abdelraoof has posted a Linux kernel patch series that extends core scheduling beyond its current SMT-only isolation model. Core scheduling has until now ensured that tasks which distrust each other never run simultaneously on CPUs that share microarchitectural state, with the isolation unit hard-wired to the SMT sibling set. The new series generalizes that unit to be configurable and adds support for a cluster unit, which on x86 is the set of CPUs sharing an L2 cache.

The motivation is that newer processors can share an L2 cache between a pair of cores while offering no SMT at all. In that topology the SMT sibling set collapses to a single CPU, leaving core scheduling with nothing to isolate, while the shared L2 exposes the same class of side channel one level up. The patches are out for review on the kernel mailing list and target cache-based cross-core attacks such as Prime+Probe; frequency-domain channels and attacks spanning a context switch are explicitly left out of scope.

How the generalized isolation unit works

  • Configurable isolation unit: The series replaces the hard-wired SMT sibling set with a configurable isolation unit, so the scheduler can enforce same-cookie co-residency at a granularity other than SMT siblings.
  • New cluster unit: A cluster unit is added, defined on x86 as the set of CPUs sharing an L2 cache, covering processors that pair cores on an L2 without exposing SMT threads.
  • Cache-based side channels: Restricting each cluster to same-cookie co-residency removes the concurrent precondition for reliable cross-core Prime+Probe-style channels between attacker and victim on L2-sharing cores.
  • Explicit non-goals: Frequency-domain channels, where one core's activity modulates the clock observed by the whole cluster, are not mitigated by this series and are listed as future work; context-switch-spanning attacks remain out of scope as with SMT core scheduling.
  • Trade-off: Isolation is stronger, but the pool of eligible cores for task placement shrinks according to the processor's cache topology.

Why it matters

Core scheduling exists so operators of multi-tenant and untrusted-workload servers can keep SMT enabled without letting hostile tasks share a core. Extending it to L2-sharing clusters matters for cloud hosts and newer CPU topologies where SMT-based isolation no longer covers the shared cache, though the reduced core selection may affect placement decisions on those parts. The series is only under mailing-list review, so no kernel release or distribution ships it yet.

Original reference: www.phoronix.com →