How to Evaluate Intel's Cache Aware Scheduling on Linux Before Mainline Merge

By

Introduction

Intel's Cache Aware Scheduling (CAS) is a set of kernel patches that improve task scheduling by taking CPU cache topology into account. For over a year, Intel engineers have been refining these patches, and they are now close to being merged into the mainline Linux kernel. Early tests on both Intel and AMD CPUs show significant performance gains, especially in workloads that are sensitive to cache contention. This step-by-step guide will walk you through obtaining, applying, and testing the CAS patches on your own system, allowing you to experience the benefits before the official merge.

How to Evaluate Intel's Cache Aware Scheduling on Linux Before Mainline Merge

What You Need

  • A Linux system (preferably with a supported Intel or AMD CPU) – CAS works best on Intel processors but has been tested on AMD as well.
  • Access to a recent mainline Linux kernel source tree (e.g., 6.x or newer).
  • The latest Cache Aware Scheduling patch series from Intel's public repository or mailing list.
  • Basic build tools: gcc, make, flex, bison, ncurses-dev (for menuconfig).
  • A separate test partition or virtual machine to avoid damaging your production system.
  • Benchmarking tools like perf, stress-ng, or your own workload scripts.

Step-by-Step Guide

Step 1: Obtain the Cache Aware Scheduling Patches

The CAS patches are usually posted on the Linux kernel mailing list (LKML) by Intel engineers. To get the latest version:

  1. Visit the LKML archives or use a tool like git am from Intel's public kernel tree. Search for patches with "cache aware scheduling" or "sched/cache" in the subject.
  2. Alternatively, fetch the entire series from a repository such as git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git (look for the sched/core branch which may contain CAS).
  3. Save the patch series as a single file (e.g., cas_v7.patch).

Step 2: Apply the Patches to Your Kernel Source

Once you have the kernel source and the patch series, apply them:

  1. Navigate to your kernel source directory: cd ~/linux
  2. Apply the patches in order: patch -p1 < ~/cas_v7.patch (or use git am if you cloned a git tree).
  3. Resolve any conflicts if they arise (usually rare for a clean base kernel).

Step 3: Configure the Kernel for Cache Aware Scheduling

Ensure that CAS is enabled in the kernel configuration:

  1. Run make menuconfig (or make nconfig).
  2. Navigate to Processor type and features > Scheduler features.
  3. Enable "Intel Cache Aware Scheduling" (or similar option, may be labeled SCHED_CACHE). If not visible, check that the correct CPU family is selected.
  4. Also enable any related options like NUMA and SCHED_MC for best results.
  5. Save and exit.

Step 4: Build and Install the Custom Kernel

Compile the kernel with CAS support:

  1. Build the kernel: make -j$(nproc)
  2. Build modules: make modules_install
  3. Install the kernel: make install
  4. Update your bootloader (e.g., update-grub for GRUB).

Step 5: Reboot and Select the New Kernel

After installation, restart your system and choose the custom kernel from the boot menu. Confirm that the kernel version matches the one you built (check uname -r).

Step 6: Verify Cache Aware Scheduling is Active

Check that CAS is running:

  1. Look at kernel messages: dmesg | grep -i cache – you should see lines about "Cache Aware Scheduling" or similar.
  2. Inspect scheduler flags: cat /sys/kernel/debug/sched_features – look for CACHE_AWARE in the list (if debugfs is mounted).

Step 7: Benchmark and Compare Performance

To see the benefits of CAS, run workloads that stress CPU cache coherence:

  1. Use a benchmark like stress-ng with cache thrashing flags: stress-ng --cache 4 --cache-ops 1000000
  2. Alternatively, run your typical multitasking workload (e.g., compilation + video encoding).
  3. Record performance metrics with perf stat focusing on cache misses (LLC-load-misses) and task migration rates.
  4. Repeat the same tests without CAS (boot a kernel without CAS patches) and compare results.

Tips for Success

  • Use a dedicated test environment – Apply patches on a non-critical system or in a virtual machine to avoid data loss.
  • Back up your current kernel – Keep your original kernel entry in GRUB as a fallback.
  • Monitor system logs – Check dmesg for any warnings or errors after booting with CAS.
  • Benchmark with consistent conditions – Disable power saving, set CPU governor to performance, and run tests multiple times for statistical reliability.
  • Combine with other scheduler tunings – For best results, also enable NUMA balancing and SCHED_MC if your CPU supports it.
  • Stay updated – The CAS patches are evolving; check Intel's LKML submissions every few weeks for newer versions with bug fixes.
Tags:

Related Articles

Recommended

Discover More

How to Handle the Removal of Newtonsoft.Json from VSTest in .NET 11 and Visual Studio 18.8Advanced Active Directory Certificate Services: Exploitation Tactics and Defender's GuideMeta Unveils New Cryptographic Protections for Messaging Backups — No App Update RequiredMastering AWS Agentic AI: A Practical Guide to Amazon Quick, Connect, and OpenAI Integrations (May 2026)10 Things You Need to Know About gcx CLI for Terminal Observability