This repository contains scripts and configs for building Linux kernels, enabling TPP/Colloid memory-tiering behavior, and running reproducible NUMA memory experiments.
- Build and boot custom kernels (base Linux + Colloid tree).
- Configure system knobs/modules for:
TPP(default NUMA migration behavior)Colloid(module-based policy on top of kernel support)
- Run experiment harnesses that:
- launch
hot_cold - generate pressure with
stress-ng - track per-node process memory with
numastat -p - save CSV + plots under timestamped experiment directories
- launch
linux/: Linux kernel source tree.colloid/: Colloid source tree (includestpp/modules + kernel tree).kernel-configs/: pre-baked.configfiles used for CloudLab-style builds.apps/hot_cold/: NUMA-aware workload used in experiments.run_exp.sh: experiment runner (standard process launch).run_exp_cgroup.sh: experiment runner that placeshot_coldin a cgroup v2 cgroup.src/numa_mem_plot/numa_mem_plot.py: sampling + plotting utility (numastat -pbased).scripts/: setup/install/helper scripts.docs/: additional notes (BOOT_KERNEL.md,LOAD_COLLOID.md, etc).
chmod +x scripts/clone_repos.sh
# Use 'ssh' if your GitHub SSH access is configured; otherwise use 'https'.
./scripts/clone_repos.sh sshThis clones:
LordDarkula/linuxLordDarkula/colloid(then checks out branchmy-colloid)matte21/tinker-linux
chmod +x scripts/install_ubuntu_dev_tools.sh
sudo ./scripts/install_ubuntu_dev_tools.shFedora flow is split: build/install GCC 13.4 first, then install other build tools.
chmod +x scripts/install_gcc_13.sh
sudo ./scripts/install_gcc_13.sh
chmod +x scripts/install_fedora_dev_tools.sh
sudo ./scripts/install_fedora_dev_tools.shYou must install Python and setup a virtualenv, which is done by another script.
chmod +x scripts/install/setup_python_ubuntu.sh
./scripts/install/setup_python_ubuntu.shThis installs the CLI command numa-mem-plot and enables module execution via python3 -m numa_mem_plot.
The top-level Makefile provides build targets for both base Linux and Colloid kernels.
make colloid_config_cloudlab
make colloid_debIn order to make the kernel visible in grub, use dpkg to install the image.
cd colloid/tpp/linux-6.3
sudo dpkg -i linux-image-<version>.deb linux-headers-<version>.debThis generates/installable kernel package artifacts from the Colloid kernel tree.
For GRUB-based systems, follow docs/BOOT_KERNEL.md.
Quick reference:
grep "menuentry" /boot/grub/grub.cfg
sudo grub-reboot "Ubuntu, with Linux 6.3.0-colloid"
sudo rebootIf the menu entry is under an advanced submenu, include the full path with > (see docs/BOOT_KERNEL.md).
To verify that the correct kernel is running
uname -rBefore experiments, choose one mode:
chmod +x scripts/enable_tpp.sh
./scripts/enable_tpp.shThis script disables swap and sets:
/sys/kernel/mm/numa/demotion_enabled = 1/proc/sys/kernel/numa_balancing = 1
chmod +x scripts/enable_colloid.sh
sudo ./scripts/enable_colloid.shThis script:
- builds Colloid modules in
colloid/tpp/ - loads
tierinit,kswapdrst, andcolloid-mon - disables swap
- sets:
/sys/kernel/mm/numa/demotion_enabled = 1/proc/sys/kernel/numa_balancing = 6
Important: run scripts/mimic_cxl_numa.sh before enabling Colloid to emulate a slower far memory NUMA tier (as noted in docs/LOAD_COLLOID.md).
hot_cold lives in apps/hot_cold/ and links against libnuma.
make -C apps/hot_coldUsage:
./apps/hot_cold/hot_cold <MiB_to_alloc> <alloc_node> <percent_hot>
# Example
./apps/hot_cold/hot_cold 1024 1 75Behavior summary:
- allocates on
alloc_node - materializes pages on that node
- resets policy to default
- repeatedly touches only hot subset for ~60s
- then idles so migration/demotion behavior can be observed
Both runners produce timestamped outputs:
experiments/exp1-YYYY-MM-DD_HH-MM-SS/exp1.csvexperiments/exp1-YYYY-MM-DD_HH-MM-SS/exp1.png- logs in
exp_logs_YYYY-MM-DD_HH-MM-SS/
chmod +x scripts/run_contention_experiment.sh
./scripts/run_contention_experiment.shchmod +x run_exp_cgroup.sh
./run_exp_cgroup.shThis runner places hot_cold into /sys/fs/cgroup/hot-cold-cg.
Both runners support environment variable overrides:
HOT_COLD_CMD="./apps/hot_cold/hot_cold 32768 1 25" \
WAIT_BEFORE_CONTEND=90 \
STRESS_DURATION=120 \
STRESS_VM_WORKERS=4 \
STRESS_VM_BYTES=4G \
WAIT_AFTER_CONTEND=60 \
./run_exp.shCommon variables:
HOT_COLD_CMDWAIT_BEFORE_CONTENDWAIT_AFTER_CONTENDSTRESS_DURATIONSTRESS_VM_WORKERSSTRESS_VM_BYTESSTRESS_EXTRA_ARGSPLOT_CMDLOGDIR
numa_mem_plot tracks per-node Private memory from numastat -p and writes a PNG plot (and optional CSV).
Example:
python3 -m numa_mem_plot \
--proc hot_cold \
--interval 1 \
--duration 180 \
--csv ./exp1.csv \
--out ./exp1.pngEquivalent CLI:
numa-mem-plot --proc hot_cold --interval 1 --duration 180 --csv ./exp1.csv --out ./exp1.pngdocs/BOOT_KERNEL.md: GRUB boot selection for alternate kernels.docs/LOAD_COLLOID.md: deeper Colloid setup/verification workflow.docs/KERNEL_MOD.md: basic kernel module load/unload commands.