Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull sched_ext fixes from Tejun Heo:

- Fix handling of migration disabled tasks in default idle selection

- update_locked_rq() called __this_cpu_write() spuriously with NULL
when @rq was not locked. As the writes were spurious, it didn't break
anything directly. However, the function could be called in a
preemptible leading to a context warning in __this_cpu_write(). Skip
the spurious NULL writes.

- Selftest fix on UP

* tag 'sched_ext-for-6.16-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext:
sched_ext: idle: Handle migration-disabled tasks in idle selection
sched/ext: Prevent update_locked_rq() calls with NULL rq
selftests/sched_ext: Fix exit selftest hang on UP

+17 -5
+8 -4
kernel/sched/ext.c
··· 1272 1272 1273 1273 #define SCX_CALL_OP(sch, mask, op, rq, args...) \ 1274 1274 do { \ 1275 - update_locked_rq(rq); \ 1275 + if (rq) \ 1276 + update_locked_rq(rq); \ 1276 1277 if (mask) { \ 1277 1278 scx_kf_allow(mask); \ 1278 1279 (sch)->ops.op(args); \ ··· 1281 1280 } else { \ 1282 1281 (sch)->ops.op(args); \ 1283 1282 } \ 1284 - update_locked_rq(NULL); \ 1283 + if (rq) \ 1284 + update_locked_rq(NULL); \ 1285 1285 } while (0) 1286 1286 1287 1287 #define SCX_CALL_OP_RET(sch, mask, op, rq, args...) \ 1288 1288 ({ \ 1289 1289 __typeof__((sch)->ops.op(args)) __ret; \ 1290 1290 \ 1291 - update_locked_rq(rq); \ 1291 + if (rq) \ 1292 + update_locked_rq(rq); \ 1292 1293 if (mask) { \ 1293 1294 scx_kf_allow(mask); \ 1294 1295 __ret = (sch)->ops.op(args); \ ··· 1298 1295 } else { \ 1299 1296 __ret = (sch)->ops.op(args); \ 1300 1297 } \ 1301 - update_locked_rq(NULL); \ 1298 + if (rq) \ 1299 + update_locked_rq(NULL); \ 1302 1300 __ret; \ 1303 1301 }) 1304 1302
+1 -1
kernel/sched/ext_idle.c
··· 903 903 * selection optimizations and simply check whether the previously 904 904 * used CPU is idle and within the allowed cpumask. 905 905 */ 906 - if (p->nr_cpus_allowed == 1) { 906 + if (p->nr_cpus_allowed == 1 || is_migration_disabled(p)) { 907 907 if (cpumask_test_cpu(prev_cpu, allowed ?: p->cpus_ptr) && 908 908 scx_idle_test_and_clear_cpu(prev_cpu)) 909 909 cpu = prev_cpu;
+8
tools/testing/selftests/sched_ext/exit.c
··· 22 22 struct bpf_link *link; 23 23 char buf[16]; 24 24 25 + /* 26 + * On single-CPU systems, ops.select_cpu() is never 27 + * invoked, so skip this test to avoid getting stuck 28 + * indefinitely. 29 + */ 30 + if (tc == EXIT_SELECT_CPU && libbpf_num_possible_cpus() == 1) 31 + continue; 32 + 25 33 skel = exit__open(); 26 34 SCX_ENUM_INIT(skel); 27 35 skel->rodata->exit_point = tc;