linux-stable/tools
Tejun Heo 60c27fb59f sched_ext: Implement sched_ext_ops.cpu_online/offline()
Add ops.cpu_online/offline() which are invoked when CPUs come online and
offline respectively. As the enqueue path already automatically bypasses
tasks to the local dsq on a deactivated CPU, BPF schedulers are guaranteed
to see tasks only on CPUs which are between online() and offline().

If the BPF scheduler doesn't implement ops.cpu_online/offline(), the
scheduler is automatically exited with SCX_ECODE_RESTART |
SCX_ECODE_RSN_HOTPLUG. Userspace can implement CPU hotpplug support
trivially by simply reinitializing and reloading the scheduler.

scx_qmap is updated to print out online CPUs on hotplug events. Other
schedulers are updated to restart based on ecode.

v3: - The previous implementation added @reason to
      sched_class.rq_on/offline() to distinguish between CPU hotplug events
      and topology updates. This was buggy and fragile as the methods are
      skipped if the current state equals the target state. Instead, add
      scx_rq_[de]activate() which are directly called from
      sched_cpu_de/activate(). This also allows ops.cpu_on/offline() to
      sleep which can be useful.

    - ops.dispatch() could be called on a CPU that the BPF scheduler was
      told to be offline. The dispatch patch is updated to bypass in such
      cases.

v2: - To accommodate lock ordering change between scx_cgroup_rwsem and
      cpus_read_lock(), CPU hotplug operations are put into its own SCX_OPI
      block and enabled eariler during scx_ope_enable() so that
      cpus_read_lock() can be dropped before acquiring scx_cgroup_rwsem.

    - Auto exit with ECODE added.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: David Vernet <dvernet@meta.com>
Acked-by: Josh Don <joshdon@google.com>
Acked-by: Hao Luo <haoluo@google.com>
Acked-by: Barret Rhoden <brho@google.com>
2024-06-18 10:09:20 -10:00
..
accounting
arch perf tools fixes and improvements for v6.10: 2024-05-21 15:45:14 -07:00
bootconfig
bpf resolve_btfids: Handle presence of .BTF.base section 2024-06-17 14:38:31 -07:00
build perf: build: introduce the libcapstone 2024-02-20 18:06:25 -08:00
certs
cgroup proc: rewrite stable_page_flags() 2024-04-25 20:56:15 -07:00
counter tools/counter: Remove unneeded semicolon 2023-12-20 11:43:31 -05:00
crypto crypto: ccp - Update return values for some unit tests 2024-02-24 08:41:20 +08:00
debugging
firewire
firmware
gpio
hv Merge 6.9-rc5 into char-misc-next 2024-04-23 13:16:03 +02:00
iio tools: iio: replace seekdir() in iio_generic_buffer 2024-01-23 22:06:56 +00:00
include bpf: Add CHECKSUM_COMPLETE to bpf test progs 2024-06-13 14:29:47 +02:00
kvm/kvm_stat
laptop
leds
lib libbpf: Make btf_parse_elf process .BTF.base transparently 2024-06-17 14:38:31 -07:00
memory-model
mm tools/mm: add thpmaps script to dump THP usage info 2024-02-22 10:24:38 -08:00
net/ynl tools: ynl: make user space policies const 2024-06-09 15:51:40 +01:00
objtool objtool: Fix compile failure when using the x32 compiler 2024-03-30 22:12:37 +01:00
pci
pcmcia
perf Revert "perf parse-events: Prefer sysfs/JSON hardware events over legacy" 2024-05-26 08:41:34 -03:00
power tools/power/cpupower: Fix Pstate frequency reporting on AMD Family 1Ah CPUs 2024-05-28 09:22:57 -06:00
rcu
sched_ext sched_ext: Implement sched_ext_ops.cpu_online/offline() 2024-06-18 10:09:20 -10:00
scripts treewide: remove meaningless assignments in Makefiles 2024-02-23 14:19:07 -08:00
sound ASoC: dapm-graph: new tool to visualize DAPM state 2024-04-21 09:58:17 +09:00
spi
testing selftests/bpf: Extend distilled BTF tests to cover BTF relocation 2024-06-17 14:38:31 -07:00
thermal tools/thermal/tmon: Fix compilation warning for wrong format 2024-01-02 09:33:19 +01:00
time
tracing tools/latency-collector: Fix -Wformat-security compile warns 2024-05-23 10:46:01 -04:00
usb
verification tools/verification: Use tools/build makefiles on rv 2024-03-20 05:39:06 +01:00
virtio tools: virtio: introduce vhost_net_test 2024-03-05 11:38:14 +01:00
wmi
workqueue workqueue: remove unnecessary import and function in wq_monitor.py 2024-03-25 10:11:32 -10:00
writeback writeback: add wb_monitor.py script to monitor writeback info on bdi 2024-05-05 17:53:51 -07:00
Makefile sched_ext: Add scx_simple and scx_example_qmap example schedulers 2024-06-18 10:09:17 -10:00