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.

sched_ext: Exit early on hotplug events during attach

There is no need to complete the entire scx initialization if a
scheduler is failing to be attached due to a hotplug event.

Exit early to avoid unnecessary work and simplify the attach flow.

Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Andrea Righi and committed by
Tejun Heo
0128c850 14c1da38

+9 -2
+9 -2
kernel/sched/ext.c
··· 4513 4513 return ERR_PTR(ret); 4514 4514 } 4515 4515 4516 - static void check_hotplug_seq(struct scx_sched *sch, 4516 + static int check_hotplug_seq(struct scx_sched *sch, 4517 4517 const struct sched_ext_ops *ops) 4518 4518 { 4519 4519 unsigned long long global_hotplug_seq; ··· 4530 4530 SCX_ECODE_ACT_RESTART | SCX_ECODE_RSN_HOTPLUG, 4531 4531 "expected hotplug seq %llu did not match actual %llu", 4532 4532 ops->hotplug_seq, global_hotplug_seq); 4533 + return -EBUSY; 4533 4534 } 4534 4535 } 4536 + 4537 + return 0; 4535 4538 } 4536 4539 4537 4540 static int validate_ops(struct scx_sched *sch, const struct sched_ext_ops *ops) ··· 4636 4633 if (((void (**)(void))ops)[i]) 4637 4634 set_bit(i, sch->has_op); 4638 4635 4639 - check_hotplug_seq(sch, ops); 4636 + ret = check_hotplug_seq(sch, ops); 4637 + if (ret) { 4638 + cpus_read_unlock(); 4639 + goto err_disable; 4640 + } 4640 4641 scx_idle_update_selcpu_topology(ops); 4641 4642 4642 4643 cpus_read_unlock();