Commit Graph

619 Commits

Author SHA1 Message Date
Changwoo Min
f53c29759e
scx_lavd: support preemption (in some scenarios) (#224)
* scx-lavd: preemption of a lower-priority task using kick cpu

When a task is enqueued to the global queue, the scheduler checks if
there is a lower priority task than the enqueued task. If so, it kicks
out the lower-priority task, hoping the newly enqueued task or another
higher-priority task runs on the kicked CPU. Kicking another CPU is
expensive as an IPI is involved, so the scheduler judiciously kicks the
CPU when its benefit (i.e., priority gap) is clear enough.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-04-09 14:25:53 +09:00
Tejun Heo
994d2a586c
Merge pull request #222 from jordalgo/header-paths
Sync libbpf_h and libbpf_local_h
2024-04-04 14:46:04 -10:00
Jordan Rome
c1925f07b4 Sync libbpf_h and libbpf_local_h
Make sure these include the same header directories.
2024-04-04 17:32:37 -07:00
Tejun Heo
1b897ae24b
Merge pull request #221 from sched-ext/htejun/misc
meson.build: Update libbpf and bpftool version requirements
2024-04-04 13:49:45 -10:00
Tejun Heo
4a77c8f8fb meson.build: Update libbpf and bpftool version requirements
The recent compat additions require new libbpf and bpftool. Update the
requirements.

- libbpf >= 1.4
- bpftool >= 7.4
2024-04-04 13:16:08 -10:00
Tejun Heo
8271bdd818
Merge pull request #220 from ThinkerYzu/uapi-path
meson: Add missing path to libbpf_local_h.
2024-04-04 11:57:48 -10:00
David Vernet
9a8ed8ab44
Merge pull request #218 from sched-ext/rusty_hotplug
Gracefully handle hotplug in scx_rusty
2024-04-04 16:03:59 -05:00
Tejun Heo
d2905e3328
Merge pull request #219 from sched-ext/rustland-core-0.2
scx_rustland_core: bump up version to 0.2
2024-04-04 11:03:34 -10:00
Kui-Feng Lee
b61dec6815 meson: Add missing path to libbpf_local_h.
The build system included linux/btf.h from system even there is one in
libbpf.  Adding libbpf/include/uapi to libbpf_local_h, the build
system will include linux/btf.h provided by libbpf.

Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
2024-04-04 14:01:59 -07:00
Andrea Righi
17a30bddc9 scx_rustland_core: bump up version to 0.2
Bump up the version of the crate and update dependencies.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-04-04 22:44:55 +02:00
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
1c6af78b79
Merge pull request #217 from sched-ext/fix-rustland-core-crate
scx_rustland_core: separate crate source code from assets
2024-04-04 09:51:43 -10:00
Andrea Righi
85a32a7b51 scx_rustland_core: separate crate source code from assets
scx_rustland_core needs to ship both a binary part and a source code
part, which will be used to build schedulers based on it.

To effectively publish the scx_rustland_core crate on crates.io we need
to properly separate the source code assets from the crate's main source
code.

To achieve this, move the assets into a separate directory and declare
them inside a [lib] section in Cargo.toml.

This allows to publish the crate on crates.io, providing also a clear
separation between source code and assets.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-04-04 21:31:02 +02:00
Tejun Heo
939ffdf0f0
Merge pull request #216 from sirlucjan/systemd-reorder
systemd: Move services to separate directory
2024-04-04 08:51:36 -10:00
Piotr Gorski
ef60559cb5
systemd: Move services to separate directory
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
2024-04-04 20:29:54 +02:00
David Vernet
163e96db59
Merge pull request #215 from sched-ext/htejun/misc
scx_lavd: Add .gitignore
2024-04-04 12:32:08 -05:00
Tejun Heo
ba52cc131b scx_lavd: Add .gitignore 2024-04-04 07:15:37 -10:00
Andrea Righi
c6fda263bd
Merge pull request #214 from sched-ext/rustland-core-update-libbpf-rs-api
scx_rustland_core: re-introduce consume_raw() libbpf-rs API
2024-04-04 18:09:54 +02:00
Andrea Righi
fbccb161a3 scx_rustland_core: re-introduce consume_raw() libbpf-rs API
Now that libbpf-rs 0.23 has been officially released with the new
consume_raw() API (https://github.com/libbpf/libbpf-rs/pull/680) we can
re-introduce the change in rustland-core that allows to use this API to
improve the quality of the code and make it slightly more efficient when
consuming tasks from BPF to user-space.

Fixes: bd2c18a ("Revert "scx_rustland_core: use new consume_raw() libbpf-rs API"")
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-04-04 17:34:57 +02:00
Andrea Righi
bc1b0e99e6
Merge pull request #213 from sched-ext/fix-ci-build
ci: make test build more robust
2024-04-04 17:34:38 +02:00
Andrea Righi
a20b0669bc ci: mitigate build overload
During the build meson attempts to distribute the workload of multiple
sub-projects across all available CPUs and parallelize each build within
those projects, resulting in an NxN task generation.

This process could potentially overload the CI systems, leading to
potential failures (see for example issue #202).

To mitigate this, always use --jobs=1 during the CI run, which
serializes the build of sub-projects and restricts the level of
parallelization to N.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-04-04 12:29:27 +02:00
Andrea Righi
3166338a74 ci: update list of build dependencies
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-04-04 12:28:57 +02:00
Andrea Righi
39e154f4e9 ci: make sure to use the proper kernel headers
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-04-04 12:28:57 +02:00
Andrea Righi
eca7ecd24e build: introduce kernel_headers build option
If we try to cross-build scx on builders with older versions of system's
linux headers (such as those provided by linux-libc-headers in older
releases of Ubuntu), we may hit build failures, due to the different
kernel ABI, such as:

 error: invalid use of undefined type ‘struct btf_enum64’

To address this, introduce a new build option called "kernel_headers"
that allows to specify a custom path for the kernel headers required
during the build process.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
2024-04-04 10:53:36 +02: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