This folder builds the kernel PACT runs on and the two out-of-tree modules the tiering subsystem needs to work:
setup_kernel.sh- builds a vanilla Linux 6.3 kernel.tierinit/,kswapdrst/- required kernel modules (details below).
Important: PACT runs on a vanilla (unpatched) Linux 6.3, but the kernel's NUMA-tiering subsystem will not behave correctly out of the box for our two-node (DRAM + CXL-like) setup. The two modules below configure it. Load both before running PACT -
run-pact.shrefuses to start if either is missing.
On a stock 6.3 kernel, the far-memory NUMA node (node 1) is treated as just
another DRAM node, so the memory-tiering subsystem builds no demotion path
between the fast tier (node 0) and the slow tier. tierinit fixes this at
load time: it assigns the far node a higher abstract distance
(FARMEM_ADISTANCE), registers it as a lower memory tier, and re-establishes
the demotion targets - without any kernel patch, using kprobes to
resolve the internal memory-tiers symbols (hence the CONFIG_KPROBES /
CONFIG_KALLSYMS_ALL requirement below). Without tierinit, PACT has no
tier structure to demote/promote pages across.
The kernel's reclaim/demotion daemon (kswapd) increments a per-node
kswapd_failures counter and permanently backs off once it gives up,
which stalls demotion during long tiering runs. kswapdrst periodically
resets kswapd_failures on the fast-tier node (every 5 s) so demotion keeps
making progress. (Derived from the Colloid memory-tiering artifact.) Without
kswapdrst, demotion can silently stop partway through a workload.
These need a kernel built with the following options (the provided
setup_kernel.sh enables them automatically):
CONFIG_INTEL_UNCORE_FREQ_CONTROL=y- uncore-frequency control (used by../env/modify-uncore-freq.sh).CONFIG_KPROBES=y,CONFIG_KALLSYMS_ALL=y
setup_kernel.sh does everything - clone vanilla v6.3, configure, build,
modules_install, install, and update-grub - and then arms a one-shot
boot of the new kernel via grub-reboot, keeping your current kernel as the
persistent default. So if 6.3 fails to boot (e.g. a missing built-in driver),
the next reboot automatically falls back to the known-good kernel.
./setup_kernel.sh # build + install + arm one-shot boot of 6.3
sudo reboot # boot into 6.3 once; confirm with: uname -rDo not run
update-grub/grub-set-defaultyourself here - that would overwrite the one-shot fallback the script set up. Only make 6.3 the persistent default (grub-set-default ...) once you have confirmed it boots.
Each module has its own Makefile. Build them either way:
./build_modules.shor build each separately (from setup/kernel/):
make -C tierinit # -> tierinit/tierinit.ko
make -C kswapdrst # -> kswapdrst/kswapdrst.korun-pact.sh loads them automatically: if a module is already loaded it is
kept, if its .ko is built it is insmoded, and if it is missing the run
aborts and asks you to build it (step 2). To load them manually (from
setup/kernel/):
sudo insmod tierinit/tierinit.ko
sudo insmod kswapdrst/kswapdrst.koVerify and inspect logs:
lsmod | grep -E 'tierinit|kswapdrst'
sudo dmesg | grep -E 'tierinit|kswapdrst'Unload (reverse order):
sudo rmmod kswapdrst tierinit