Commit Graph

596 Commits

Author SHA1 Message Date
David Vernet
622b61dd2f
rusty: Support restarting rusty on hotplug events
The scx_rusty scheduler does not support hotplug, and expects a static
host topology throughout its runtime. Though the kernel does have
support for detecting hotplug events, we currently don't detect this in
the kernel, nor surface it to user space when it happens. Now that we
have scx_bpf_exit(), we can gracefully exit the kernel in the event of a
hotplug, and communicate to user space that it should restart the
scheduler.

This patch adds that support to scx_rusty. Note that this assumes that
we're running on a recent enough kernel that has scx_bpf_exit(). If it
doesn't, then we instead just error out of the kernel scheduler and exit
the application.

Signed-off-by: David Vernet <void@manifault.com>
2024-04-04 14:52:48 -05:00
David Vernet
052ce428a3
uei: Export exit_code from UserExitInfo
Newer kernels also support exiting gracefully with an exit code. Let's
update the UserExitInfo struct to also read and export this value.

Signed-off-by: David Vernet <void@manifault.com>
2024-04-04 14:52:45 -05:00
Tejun Heo
7d335fa197
Merge pull request #211 from nycko123/main
openrc init support
2024-04-03 10:25:06 -10:00
Tejun Heo
7b068d310a
Merge pull request #212 from sched-ext/sccache
Doc & build: Warn about sccache
2024-04-03 10:24:31 -10:00
Tejun Heo
d62a15193e Doc & build: Warn about sccache
Build fails with sccache.

- Update meson-scripts/build_bpftool to support sccache. Unfortunately, this
  isn't enough.

- Update README to warn about sccache and add the instruction to disable it
  for buliding scx.

- Also add ⚠️ to make boot loader update step more prominent in arch
  installation instruction.
2024-04-03 10:18:45 -10:00
Damian N
a176c1344f
Merge branch 'sched-ext:main' into main 2024-04-03 22:04:28 +02:00
Damian N.
2f998e2a2b
services/openrc: symlinking fix 2024-04-03 22:02:14 +02:00
Tejun Heo
f8c150cbaf
Merge pull request #210 from jordalgo/fedora
Add install instructions for Fedora
2024-04-03 09:38:02 -10:00
Jordan Rome
a880ca5433 Add install instructions for Fedora
Also create a separate INSTALL.md as the primary REAME.md is
getting a big long.
2024-04-03 12:34:37 -07:00
Damian N.
33abc27183
openrc meson.build: symlinking 1st try 2024-04-03 21:21:26 +02:00
Damian N.
505f4c47a0
services/openrc: mesonfile 2024-04-03 19:57:32 +02:00
Damian N.
e7b4a03034
fixed option name in meson.build 2024-04-03 19:49:37 +02:00
Damian N.
5163d8b441
deleted: services/scx.initrd 2024-04-03 19:47:41 +02:00
Damian N.
3e6bcab337
mv scx.initrd openrc/scx.initrd 2024-04-03 19:45:55 +02:00
Damian N.
6e02c8eb5c
main meson: added openrc options 2024-04-03 19:38:28 +02:00
Damian N.
e19bc1b62d
openrc init.d service file 2024-04-03 19:30:22 +02:00
Tejun Heo
86f1550181
Update README.md 2024-04-03 06:48:30 -10:00
David Vernet
4bbed4f054
Merge pull request #209 from sched-ext/htejun-patch-1
Update Arch install instruction in README.md
2024-04-03 11:43:42 -05:00
Tejun Heo
f32e4b2527
Update README.md 2024-04-03 06:22:53 -10:00
Tejun Heo
361bed1545
Merge pull request #208 from sirlucjan/cachyos-keyring
Update cachyos-keyring
2024-04-03 06:10:57 -10:00
Piotr Gorski
5b94fb8930
Update cachyos-keyring
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-04-03 17:45:22 +02:00
Tejun Heo
a60737a6bf
Merge pull request #207 from sched-ext/api-updates
scx: Apply API updates from sched_ext
2024-04-02 14:26:42 -10:00
David Vernet
4e124c8c5f
Merge pull request #206 from sched-ext/rusty_sync_fix
rusty: Check LOCAL_DSQ length for WAKE_SYNC
2024-04-02 17:47:08 -05:00
Tejun Heo
348fe53256 Sync from kernel
Synchronize stragglers.

- Bug fix in __COMPAT_read_enum().
- A cosmetic difference in scx_qmap.bpf.c.
- Stray 'p' when calling getopt() in scx_simple.c.

After this the kernel tree and scx repo are in sync.
2024-04-02 11:29:50 -10:00
Tejun Heo
b925bdf94d Cargo.toml: Update libbpf-rs/cargo dependencies to 0.23 and drop patch.crates-io sections
New versions of libbpf-rs and libbpf-cargo are now available with all the
needed features. Update the dependencies and drop the patch sections.
2024-04-02 11:19:39 -10:00
Tejun Heo
6f81409df4 Bump versions
- scx_utils bumped from 0.6.0 to 0.7.0.

- Repo and rust schedulers get a PATCH level bump.
2024-04-02 10:58:50 -10:00
Tejun Heo
1ceb97276e meson.build: Update libbpf/bpftool commits to latest 2024-04-02 10:46:02 -10:00
Tejun Heo
b7b402836d scx_utils: Sync libbpf SHA1s with the rest 2024-04-02 10:35:21 -10:00
Tejun Heo
f3e20ae9b3 scx_rustland: Apply API updates and add --exit-dump-len option to scx_rustland 2024-04-02 10:30:56 -10:00
David Vernet
5088328f9e
rusty: Check LOCAL_DSQ length for WAKE_SYNC
In rusty_select_cpu(), if a task is WAKE_SYNC, we'll currently migrate
the task to that CPU if there are any idle cores on the system. As in
[0], this condition is insufficient, as there could be idle cores
elsewhere on the system, but still tasks piled up on a single local DSQ.
Let's add a condition that the local DSQ has to be empty in order to
apply the WAKE_SYNC migration.

Before patch:

[void@maniforge src]$ hackbench
Running in process mode with 10 groups using 40 file descriptors each (== 400 tasks)
Each sender will pass 100 messages of 100 bytes
Time: 0.433

With patch:
[void@maniforge src]$ hackbench
Running in process mode with 10 groups using 40 file descriptors each (== 400 tasks)
Each sender will pass 100 messages of 100 bytes
Time: 0.035

Signed-off-by: David Vernet <void@manifault.com>
2024-04-02 15:17:32 -05:00
Tejun Heo
06fdae177f vmlinux: Update to 5dc95302301fb7e51cd4d218008b9dad10110069 2024-04-02 10:08:18 -10:00
Tejun Heo
98e586ce63 vmlinux: Drop unused old vmlinux headers
No need to keep them around.
2024-04-02 10:08:09 -10:00
Tejun Heo
dfa978d166 scx_lavd: Apply API updates 2024-04-02 10:08:02 -10:00
Tejun Heo
0c07f382b1 scx_rusty: Apply API updates 2024-04-02 10:07:54 -10:00
Tejun Heo
59bbd800c1 compat: Implement scx_utils::compat and fix up scx_layered
Implement scx_utils::compat to match C's scx/compat.h and update
scx_layered. Other rust scheds are still broken.
2024-04-02 07:08:56 -10:00
Changwoo Min
048662a692
Merge pull request #204 from multics69/scx-lavd-runtime-runfreq
scx_lavd: directly accumulate task's runtimes for consecutive runnings
2024-03-31 16:23:29 +09:00
Changwoo Min
3a3bd2a750 scx_lavd: increase the upper bound of ineligible duration
Change the upper bound of ineligible duration (LAVD_ELIGIBLE_TIME_MAX).
The updated (2x increased) upper bound reflects the distribution of
tasks' eligible_delta_ns better.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-03-30 22:59:06 +09:00
Changwoo Min
8efaf0c4c2 scx_lavd: improve the accuracy of task's run_freq
Change the calculation of the run_frequence using the wait_period from
the last time the task yielded CPU to this time when the task is
running. The old implementation measures the time interval between the
last stopping and the current running and increases run_freq without
reason.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-03-30 22:55:17 +09:00
Changwoo Min
fe3efb8ce2 scx_lavd: rename last_{start/stop/wait/wake}_clk for consistency
Change the last_{start/stop/wait/wake}_clk in task_ctx to
last_{running/stopping/quiescent/runnable}_clk, matching with state
transition names. In addition, add comments and reorder fields in
task_ctx for readability.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-03-30 10:13:20 +09:00
Tejun Heo
891df57b98 scheds/c: Fix up C schedulers
Fix up the remaining C schedulers after the recent API and header updates.
Also drop stray -p from usage help message from some schedulers.
2024-03-29 12:15:45 -10:00
Tejun Heo
9447cb27b2 scx: Sync from kernel, some schedulers are broken
Sync from kernel to receive new vmlinux.h and the updates to common headers.
This includes the following updates:

- scx_bpf_switch_all() is replaced by SCX_OPS_SWITCH_PARTIAL flag.

- sched_ext_ops.exit_dump_len added to allow customizing dump buffer size.

- scx_bpf_exit() added.

- Common headers updated to provide backward compatibility in a way which
  hides most complexities from scheduler implementations.

scx_simple, qmap, central and flatcg are updated accordingly. Other
schedulers are broken for the moment.
2024-03-29 12:14:26 -10:00
Changwoo Min
3ba10a8d4f scx_lavd: accumulate consecutive runnings
When a task runs more than once (running <->stopping) within one
runnable-quiescent transition, accumulate runtime of multiple runnings
for statistics. This helps to get the task's runtime per schedule when
supposing that a huge time slice is given, which is what we want to
collect for scheduling decisions.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-03-29 17:19:30 +09:00
Changwoo Min
7b99ed9c5c scx_lavd: drop runtime_boost using slice_boost_prio
Remove runtime_boost using slice_boost_prio. Without slice_boost_prio,
the scheduler collects the exact time slice.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-03-29 16:31:03 +09:00
Changwoo Min
5629189527 scx_lavd: change update_stat_for_*() for consistency
Let's change the function names of update_stat_for_*() as follow their
callers for consistency and less confusion.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-03-29 14:49:06 +09:00
Changwoo Min
04c9e7fe9d
Merge pull request #201 from multics69/perf-vdeadline01
scx_lavd: fix merge conflicts between PR 197 and 199
2024-03-28 14:15:00 +09:00
Changwoo Min
0ea1aab070 scx_lavd: fix merge conflicts
Merge branch 'perf-vdeadline01' of github.com:sched-ext/scx into perf-vdeadline01
2024-03-28 13:49:19 +09:00
Changwoo Min
360d4ec457
Merge pull request #199 from sched-ext/lavd-task-states
scx_lavd: Clean up task state transition tracking
2024-03-28 13:43:56 +09:00
Tejun Heo
340938025f
Merge pull request #200 from sched-ext/layered_delete
layered: Use TLS map instead of hash map
2024-03-27 17:09:20 -10:00
Changwoo Min
60472db845
Merge pull request #197 from multics69/perf-vdeadline01
scx_lavd: improve virtual deadline calculation
2024-03-28 11:44:54 +09:00
Changwoo Min
67f41c7d83 scx_lavd: bug fix: slice_boost should be update before adjusted runtime
The run_time_boosted_ns calculation requires updated slice_boost_prio,
so updating slice_boost_prio should be done before updating
run_time_boosted_ns.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-03-28 11:21:42 +09:00