]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sched_ext: Relocate check_hotplug_seq() call in scx_ops_enable()
authorTejun Heo <tj@kernel.org>
Fri, 27 Sep 2024 20:02:39 +0000 (10:02 -1000)
committerTejun Heo <tj@kernel.org>
Fri, 27 Sep 2024 20:02:39 +0000 (10:02 -1000)
commit1bbcfe620e03aafc542b1c649dea0a9499a4490f
tree0bddf3f6bff7d1c3dbd5d4402b27e95afcad39cb
parent6f34d8d382d64e7d8e77f5a9ddfd06f4c04937b0
sched_ext: Relocate check_hotplug_seq() call in scx_ops_enable()

check_hotplug_seq() is used to detect CPU hotplug event which occurred while
the BPF scheduler is being loaded so that initialization can be retried if
CPU hotplug events take place before the CPU hotplug callbacks are online.

As such, the best place to call it is in the same cpu_read_lock() section
that enables the CPU hotplug ops. Currently, it is called in the next
cpus_read_lock() block in scx_ops_enable(). The side effect of this
placement is a small window in which hotplug sequence detection can trigger
unnecessarily, which isn't critical.

Move check_hotplug_seq() invocation to the same cpus_read_lock() block as
the hotplug operation enablement to close the window and get the invocation
out of the way for planned locking updates.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: David Vernet <void@manifault.com>
kernel/sched/ext.c