[PATCH] tools/sched_ext: scx_flatcg: Document cgroup v2 requirement
From: luoliang
Date: Wed Jun 03 2026 - 05:07:03 EST
From: Liang Luo <luoliang@xxxxxxxxxx>
The BPF program relies on cgroup v2-specific features - specifically
BPF_MAP_TYPE_CGRP_STORAGE and cgroup v2 kfuncs (bpf_cgroup_ancestor,
bpf_cgroup_from_id, scx_bpf_task_cgroup, ...), none of which are
available on cgroup v1. The current file header describes the
algorithm but does not make this runtime requirement explicit, so
users running on a cgroup v1-only system get a confusing BPF load
error with no clear pointer to the cause.
Document the requirement in a Note paragraph at the end of the file
header so that it is visible to anyone reading the source.
No functional change.
Signed-off-by: Liang Luo <luoliang@xxxxxxxxxx>
---
tools/sched_ext/scx_flatcg.bpf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/sched_ext/scx_flatcg.bpf.c b/tools/sched_ext/scx_flatcg.bpf.c
index fec359581826..067e1a7991d4 100644
--- a/tools/sched_ext/scx_flatcg.bpf.c
+++ b/tools/sched_ext/scx_flatcg.bpf.c
@@ -42,6 +42,9 @@
* The scheduler first picks the cgroup to run and then schedule the tasks
* within by using nested weighted vtime scheduling by default. The
* cgroup-internal scheduling can be switched to FIFO with the -f option.
+ *
+ * Note: Requires cgroup v2 (uses BPF_MAP_TYPE_CGRP_STORAGE and cgroup v2
+ * BPF kfuncs, neither of which are available on cgroup v1).
*/
#include <scx/common.bpf.h>
#include "scx_flatcg.h"
--
2.25.1