This repository contains the open-source release of XCG, an extension to the Linux cgroup v2 framework that improves cgroup scalability for serverless container startup. It is the implementation accompanying the paper:
Ruofan Xiong, Li Wang, Zhihao Zhang, Xinbiao Gan, and Yiming Zhang. XCG: Decoupling Control from Configuration to Improve Cgroup Scalability with Flat Mapping. SIGOPS ATC 2026. https://doi.org/10.1145/3828523.3857116
XCG implements, on Linux kernel v6.7.2.
patches/
0001-xcg-core.patch cgroup core: ioctl dispatch, XCG domains,
flat mapping, async-create framework,
deferred destroy, UAPI header, README
0002-xcg-cpu-controller.patch CPU controller: async create, lazy per-CPU
cfs_rq/se, tg recycle, hotplug prewarm
0003-xcg-memory-controller.patch memory controller: async create, lazy
per-NUMA nodeinfo, memcg recycle
0004-xcg-pids-cpuset-controllers.patch pids + cpuset: async create, lazy
per-CPU counter / effective masks,
recycle lists
0005-xcg-io-controller.patch io (blkcg): async create, lazy per-policy
cpd[] + per-CPU lhead, recycle list
0006-xcg-selftests.patch 26 kselftests (test_xcg_*) + xcg_helpers.h
under tools/testing/selftests/cgroup/
The patches carry a series file for quilt; they also apply cleanly in
number order with git apply or patch -p1.
Starting from a pristine Linux v6.7.2 tree
(https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.7.2.tar.xz):
cd linux-6.7.2
for p in /path/to/this/repo/patches/*.patch; do
patch -p1 < "$p"
done(or git apply each patch in order inside a git checkout of v6.7.2.)
XCG is controlled by CONFIG_CGROUP_XCG (bool, default y, depends on
CGROUPS):
make defconfig
make -j$(nproc)
sudo make modules_install installBoot the patched kernel with cgroup v2 mounted.
The patched tree ships kselftests under tools/testing/selftests/cgroup/.
On a machine (a VM is recommended) booted into the patched kernel:
make -C tools/testing/selftests/cgroup
cd tools/testing/selftests/cgroup
echo "+cpu +memory +pids +cpuset +io" | \
sudo tee /sys/fs/cgroup/cgroup.subtree_control
sudo ./test_xcg_errors
sudo ./test_xcg_mkdir
sudo ./test_xcg_set
sudo ./test_xcg_stat
sudo ./test_xcg_attach
sudo ./test_xcg_migrate
sudo ./test_xcg_async
sudo ./test_xcg_async_recycle
sudo ./test_xcg_memcg_async
sudo ./test_xcg_pids_async
sudo ./test_xcg_cpuset_async
sudo ./test_xcg_io_async
sudo ./test_xcg_domain
sudo ./test_xcg_hierarchy
sudo ./test_xcg_destroy_fast
sudo ./test_core
sudo ./test_memcontrol See the in-tree README after applying for the full design/code map.
The patches are licensed under the same terms as the Linux kernel:
GPL-2.0 (see COPYING in the kernel tree); the UAPI header
include/uapi/linux/xcg.h is GPL-2.0 WITH Linux-syscall-note.
Individual files carry SPDX identifiers.