sched_ext: Fixes for v7.1-rc6

Two low-risk fixes:
 
 - Drop a spurious warning that can fire during cgroup migration while a
   sched_ext scheduler is loaded.
 
 - Fix a drgn-based debug script that broke after scheduler state moved into
   a per-scheduler struct.
 -----BEGIN PGP SIGNATURE-----
 
 iIQEABYKACwWIQTfIjM1kS57o3GsC/uxYfJx3gVYGQUCah9Z2A4cdGpAa2VybmVs
 Lm9yZwAKCRCxYfJx3gVYGT1zAQCjQeWMm3ULnezjh6Oqx7KhPAdq20Gfzx6/hwjM
 Lq1xHAD7B1aiUrMc6Hg405EI6vP9lScjxF6TyvEqmtfL0EmA0ww=
 =mZNl
 -----END PGP SIGNATURE-----

Merge tag 'sched_ext-for-7.1-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext

Pull sched_ext fixes from Tejun Heo:
 "Two low-risk fixes:

   - Drop a spurious warning that can fire during cgroup migration while
     a sched_ext scheduler is loaded

   - Fix a drgn-based debug script that broke after scheduler state
     moved into a per-scheduler struct"

* tag 'sched_ext-for-7.1-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext:
  sched_ext: Don't warn on NULL cgrp_moving_from in scx_cgroup_move_task()
  tools/sched_ext: Fix scx_show_state per-scheduler state reads
This commit is contained in:
Linus Torvalds 2026-06-03 08:52:26 -07:00
commit ac5c3716c6
2 changed files with 19 additions and 10 deletions

View file

@ -4402,11 +4402,13 @@ void scx_cgroup_move_task(struct task_struct *p)
return;
/*
* @p must have ops.cgroup_prep_move() called on it and thus
* cgrp_moving_from set.
* scx_cgroup_can_attach() sets cgrp_moving_from only when the task's
* cgroup changes. Migration keys off css rather than cgroup identity,
* so it can hand an unchanged-cgroup task here with cgrp_moving_from
* NULL. Nothing to report to the BPF scheduler then, so skip it and
* keep prep_move and move paired.
*/
if (SCX_HAS_OP(sch, cgroup_move) &&
!WARN_ON_ONCE(!p->scx.cgrp_moving_from))
if (SCX_HAS_OP(sch, cgroup_move) && p->scx.cgrp_moving_from)
SCX_CALL_OP_TASK(sch, cgroup_move, task_rq(p),
p, p->scx.cgrp_moving_from,
tg_cgrp(task_group(p)));

View file

@ -27,18 +27,25 @@ def read_static_key(name):
def state_str(state):
return prog['scx_enable_state_str'][state].string_().decode()
def read_root_ops_name():
if root:
return root.ops.name.string_().decode()
return ''
def read_root_field(name, default):
if root:
return getattr(root, name).value_()
return default
root = prog['scx_root']
enable_state = read_atomic("scx_enable_state_var")
if root:
print(f'ops : {root.ops.name.string_().decode()}')
else:
print('ops : ')
print(f'ops : {read_root_ops_name()}')
print(f'enabled : {read_static_key("__scx_enabled")}')
print(f'switching_all : {read_int("scx_switching_all")}')
print(f'switched_all : {read_static_key("__scx_switched_all")}')
print(f'enable_state : {state_str(enable_state)} ({enable_state})')
print(f'aborting : {prog["scx_aborting"].value_()}')
print(f'bypass_depth : {prog["scx_bypass_depth"].value_()}')
print(f'aborting : {read_root_field("aborting", False)}')
print(f'bypass_depth : {read_root_field("bypass_depth", 0)}')
print(f'nr_rejected : {read_atomic("scx_nr_rejected")}')
print(f'enable_seq : {read_atomic("scx_enable_seq")}')