From: Matt Fleming <matt@readmodwrite.com>
To: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>
Cc: Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>,
sched-ext@lists.linux.dev, kernel-team@cloudflare.com,
Matt Fleming <mfleming@cloudflare.com>
Subject: WARNING at kernel/sched/ext.c:3227 scx_cgroup_move_task+0xa8/0xb0
Date: Mon, 1 Jun 2026 13:41:56 +0100 [thread overview]
Message-ID: <20260601124156.2205704-1-mfleming@cloudflare.com> (raw)
Hi,
We're hitting a WARN_ON_ONCE in scx_cgroup_move_task() while running
scx_lavd. The stack is:
scx_cgroup_move_task+0xa8/0xb0
sched_move_task+0x134/0x290
cpu_cgroup_attach+0x39/0x70
cgroup_migrate_execute+0x37d/0x450
cgroup_update_dfl_csses+0x1e3/0x270
cgroup_subtree_control_write+0x3e7/0x440
The trigger is systemd's user@UID.service startup. The user manager
writes +cpu +memory +pids to its own subtree_control. Because +cpu is
already inherited, the cpu task_group doesn't change -- but
find_css_set() returns a css_set whose subsys[cpu] pointer differs
from the source (different css object, same tg_cgrp()). That sets
the cpu bit in mgctx->ss_mask, so both cpu_cgroup_can_attach() and
cpu_cgroup_attach() run.
scx_cgroup_can_attach() checks "from == to" in tg_cgrp() and skips the
task, leaving cgrp_moving_from NULL. But cpu_cgroup_attach() calls
sched_move_task() unconditionally, so scx_cgroup_move_task() fires and
WARNs on the NULL.
I managed to reproduce by cycling systemctl stop/start
user@UID.service. The hit rate varies with css_set cache state.
Any thoughts on the best way to resolve this?
Thanks,
Matt
next reply other threads:[~2026-06-01 12:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 12:41 Matt Fleming [this message]
2026-06-01 19:22 ` [PATCH sched_ext/for-7.1-fixes] sched_ext: Don't warn on NULL cgrp_moving_from in scx_cgroup_move_task() Tejun Heo
2026-06-01 20:19 ` Andrea Righi
2026-06-02 21:35 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260601124156.2205704-1-mfleming@cloudflare.com \
--to=matt@readmodwrite.com \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=kernel-team@cloudflare.com \
--cc=mfleming@cloudflare.com \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox