linux-mauri870

Building a custom gaming kernel optimized for dual-CCD AMD X3D processors

30 Mar 2026

Mauri de Souza Meneguzzo

Why a custom kernel?

The mainline kernel is general-purpose. It makes conservative choices to work well on servers, embedded devices, VMs, and desktops equally.

A gaming workstation has a very different profile:

2

The AMD 9950X3D architecture

The Ryzen 9 9950X3D has two dies (CCDs), each with 8 cores.

CCD0: lower clocks, but carries the 3D V-Cache 96 MB of L3 stacked on top of the silicon. Games with large working sets (shader caches, mesh data) run faster here.

CCD1: higher clocks, less cache. Better for single-threaded burst workloads.

The problem: the kernel treats all cores as equal. OS tasks, IRQs, and game threads land anywhere. When IRQs land on X3D cores, they interrupt the game thread and can flush cache state.

3

The tickless solution

Linux's NO_HZ_FULL makes a CPU core stop generating timer ticks when exactly one task is running on it.

No ticks = no periodic interrupts = the game thread runs uninterrupted.

Boot parameters for the 9950X3D:

nohz_full=1-7,16-23
rcu_nocbs=1-7,16-23
irqaffinity=8-15,24-31

X3D cores (CCD0) run tickless. IRQs are pinned to CCD1 cores. The game scheduler sees its X3D cores free of OS jitter.

4

BORE scheduler

BORE — Burst-Oriented Response Enhancer patches the CFS scheduler to track burst history per task.

Tasks that historically run in short bursts (UI threads, game engines, audio) get priority over long-running CPU-bound tasks.

Games stutter when the scheduler pulls a background compile job onto a core mid-frame. BORE reduces this by keeping bursty tasks preemptable and responsive.

Combined with PREEMPT_FULL and 1000 Hz tick rate, context switches happen at sub-millisecond granularity.

5

BBR3 TCP congestion control

BBR3 is Google's bandwidth-delay product congestion controller.

Stock kernels ship with CUBIC. BBR3 is not in mainline yet.

For gaming, BBR3 matters when:

BBR3 tracks bandwidth and RTT independently. It does not back off on loss like CUBIC does, leading to better throughput under congested or lossy links.

6

Compiler: Clang + ThinLTO + -O3

The kernel is built with Clang 22 instead of GCC.

Benefits:

Polly restructures loop nests for better cache locality and can auto-parallelize inner loops. For the scheduler hot paths and memory management code, this yields measurable improvements.

Build time: ~15–20 minutes on the 9950X3D itself.

7

Patch: HDMI FRL (4K@144Hz)

HDMI Fixed Rate Link is required for HDMI 2.1 bandwidth (48 Gbps).

Without it, AMD GPUs top out at 4K@60Hz over HDMI. With it, 4K@144Hz works.

The patch adds FRL negotiation to the amdgpu DRM driver. It's not in mainline because the spec is partially proprietary and testing coverage is limited.

8

Patch: keep foreground workloads in VRAM when under pressure

This drm/ttm patch prioritizes keeping protected (pinned) GPU workloads in VRAM under memory pressure.

Without it, the kernel can evict active game assets to system RAM when VRAM fills up. The result is a stutter as the GPU driver re-uploads data.

With the patch, the eviction policy prefers unpinned allocations (idle textures, shader caches from closed apps) before touching active game data.

9

Other patches

10

Config highlights

PREEMPT_FULL          # full kernel preemption
HZ=1000               # 1 ms timer resolution
NO_HZ_FULL            # tickless on designated cores
SCHED_EXT             # pluggable scheduler (sched_ext)
TRANSPARENT_HUGEPAGE_MADVISE
NTSYNC                # Wine NT synchronization primitives
LTO_CLANG_THIN        # ThinLTO

sched_ext allows loading a BPF program as the scheduler. Useful for experiments without recompiling the kernel.

11

Building and installing

makepkg -si -f

This compiles the kernel using the PKGBUILD, runs make -j$(nproc), and installs via pacman.

GRUB picks it up automatically. Select it at boot or set it as default in /etc/default/grub.

12

Useful links

github.com/mauri870/linux-kernel

BORE scheduler

BBR3

My talks are written with golang.org/x/tools/present

Find this talk at talks.mauri870.com

13

Thank you

30 Mar 2026

Mauri de Souza Meneguzzo

Use the left and right arrow keys or click the left and right edges of the page to navigate between slides.
(Press 'H' or navigate to hide this message.)