本补丁把 sched_ext 的 ops.cgroup_set_bandwidth() 加入 bpf_scx_check_member 的 sleepable 白名单,因其调用路径(tg_set_bandwidth → scx_group_set_bandwidth)本就持有可睡眠的 percpu_rwsem 读端。同时引入 DEFINE_SCX_COMPAT_MARKER 宏和首个 marker(scx_compat_marker_cgroup_set_bandwidth_may_sleep),通过 __used __retain 保证 BTF 留存,让 userspace loader 能...
本补丁把 sched_ext 的 ops.cgroup_set_bandwidth() 加入 bpf_scx_check_member 的 sleepable 白名单,因其调用路径(tg_set_bandwidth → scx_group_set_bandwidth)本就持有可睡眠的 percpu_rwsem 读端。同时引入 DEFINE_SCX_COMPAT_MARKER 宏和首个 marker(scx_compat_marker_cgroup_set_bandwidth_may_sleep),通过 __used __retain 保证 BTF 留存,让 userspace loader 能检测该能力。v2 主要修复 v1 中漏掉 __retain 导致 CONFIG_LD_DEAD_CODE_DATA_ELIMINATION 下会被链接器回收的问题。该补丁已被 Tejun Heo 合入 sched_ext/for-7.3-fixes。