Buconos

How to Test Intel's Cache Aware Scheduling on Your Linux System

Published: 2026-05-15 05:39:29 | Category: Hardware

Introduction

For over a year, Intel engineers have been developing a feature called Cache Aware Scheduling for the Linux kernel. This technology optimizes how the kernel distributes tasks across CPU cores by taking into account each core's cache topology—especially the shared L2 and L3 caches. Early tests on both Intel and AMD processors show significant performance gains in multi-threaded workloads. The patches are now nearing acceptance into the mainline kernel, making this an exciting time for Linux enthusiasts to try them out. This guide will walk you through obtaining the latest Cache Aware Scheduling patches, compiling a custom kernel, and running basic benchmarks to verify the improvements.

How to Test Intel's Cache Aware Scheduling on Your Linux System

What You Need

  • A Linux distribution (Ubuntu 20.04+ or Fedora 34+ recommended) with root access.
  • A multi-core CPU (Intel or AMD) – the more cores, the more noticeable the benefits.
  • At least 10 GB of free disk space for kernel source and build artifacts.
  • Basic familiarity with the terminal and compiling software.
  • The following packages installed:
    • git
    • build-essential (or equivalent: gcc, make, libncurses-dev)
    • linux-source or a cloned kernel tree from kernel.org
    • bc, kmod, libelf-dev
    • Optional: phoronix-test-suite for benchmarking

Step-by-Step Instructions

Step 1: Obtain the Latest Kernel Source

Clone the mainline Linux kernel repository from kernel.org. Open a terminal and run:

git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

This will create a directory named linux. Move into it:

cd linux

Step 2: Fetch the Cache Aware Scheduling Patches

Intel engineers maintain a public Git branch with the patches. Add their remote and fetch the relevant branch:

git remote add intel-cas https://github.com/intel/linux-cas.git
git fetch intel-cas

Then create a local branch based on the cas-core branch (the name may change, check Intel's documentation):

git checkout -b my-cas intel-cas/cas-core

You now have a kernel tree that includes all the Cache Aware Scheduling patches applied on top of a recent mainline base.

Step 3: Configure the Kernel for Cache Aware Scheduling

Before compiling, you must enable the feature. Use the kernel configuration interface:

make menuconfig

Navigate to:

  • Processor type and featuresCache Aware Scheduling (press Y to enable).

If you don't see this option, ensure you are on the correct CAS branch. Also verify that SMP (Symmetric Multi-Processing) is enabled, as CAS relies on it. Save and exit.

For a quick test, you can accept the defaults for all other options. But to get the best results, consider enabling NUMA and SCHED_MC (multi-core scheduler).

Step 4: Compile the Kernel

Compilation can take 30 minutes to a few hours depending on your hardware. Use as many CPU cores as possible:

make -j$(nproc)

If you encounter missing dependencies, install them and re-run. Once finished, compile the kernel modules:

make modules_install

Step 5: Install the New Kernel

Copy the compiled kernel image and generate the initial RAM disk (initramfs):

make install
update-initramfs -c -k $(make kernelrelease)

On Fedora, use dracut instead. Update your bootloader (GRUB):

update-grub   # Ubuntu
# or on Fedora: grub2-mkconfig -o /boot/grub2/grub.cfg

Step 6: Reboot and Select the CAS Kernel

Restart your system. In the GRUB menu, choose the kernel with my-cas or the version you just compiled. If no menu appears, hold Shift (BIOS) or press Esc (UEFI) during boot. After logging in, verify the kernel version:

uname -r

It should match the release from the CAS branch.

Step 7: Confirm Cache Aware Scheduling Is Active

Check the kernel boot messages for CAS-related entries:

dmesg | grep -i cache-aware

If you see lines like “Cache Aware Scheduling: enabled”, the feature is active. You can also look at /proc/schedstat or run cat /sys/kernel/debug/sched/debug for more verbose output.

Step 8: Run Basic Benchmarking

To see the performance impact, compare a multi-threaded workload with and without CAS. Install the Phoronix Test Suite or use simple tools like stress-ng and perf.

Example using stress-ng to measure cache thrashing:

stress-ng --cache 4 --cache-ops 1000000 --cache-level 3 --metrics-brief

Run the same test on the stock kernel (before applying CAS) and on the CAS kernel. Note the throughput and latency differences.

For more realistic results, test with Phoronix Test Suite:

phoronix-test-suite benchmark cache

The suite includes memory‑sensitive benchmarks like pts/cache and pts/stream.

Tips for Success

  • Back up your data: Compiling and installing a custom kernel carries a small risk of system instability. Always keep a known‑good kernel as a fallback in your bootloader.
  • Update your patches: Intel continues to refine the CAS patches. Check their repository regularly for new versions—the branch name may change as patches approach mainline.
  • Test on both Intel and AMD: Though developed by Intel, CAS benefits AMD processors too. Try it on a Ryzen system and you may observe similar gains.
  • Monitor temperatures: Cache‑aware scheduling can increase CPU utilization under certain workloads. Ensure your cooling is adequate.
  • Use a dedicated test partition: If you are new to kernel building, prepare a test environment such as a virtual machine or a separate root partition to avoid impacting your production system.
  • Share your results: Post your benchmarks on the Linux kernel mailing list or in community forums. Early feedback helps Intel finalize the feature before it hits mainline.