[PATCH 2/3] sched_ext: scx_qmap: Size the cid range buffer for large machines
From: Tejun Heo
Date: Mon Oct 05 2026 - 14:04:33 EST
The hier rows' cid range buffer holds 128 characters. When no two
consecutive cids share an owner, which SMT siblings numbered far apart
produce, every cid prints on its own and the list is cut off with "...".
Size the buffer for that worst case at the build's cpu cap, off the stack.
Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
---
tools/sched_ext/scx_qmap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/sched_ext/scx_qmap.c b/tools/sched_ext/scx_qmap.c
index d5226e071657..96e485c9e877 100644
--- a/tools/sched_ext/scx_qmap.c
+++ b/tools/sched_ext/scx_qmap.c
@@ -162,7 +162,9 @@ static void format_cid_ranges(struct qmap_arena *qa, s32 owner, char *buf, size_
/* partition summary + one row per sched: weight, cpus, dispatch rate, cids */
static void print_hier(struct qmap_arena *qa, struct hier_prev *prev, u64 own_cgid)
{
- char ranges[128], who[16];
+ /* worst case, no ranges: a comma and up to six digits per cid */
+ static char ranges[SCX_QMAP_MAX_CPUS * 7];
+ char who[16];
const char *rr = "-";
double secs;
u32 i;
--
2.55.0