-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
introduce CO:RE enum readers and use them for scx_central #894
Conversation
scheds/include/scx/enums.bpf.h
Outdated
struct scx_enums _scx_enum; | ||
|
||
#define SCX_ENUM(name) \ | ||
(_scx_enum.SCX_##name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes each enum access a memory dereference. If you make each enum a const volatile
variable and set them from the userspace side during init, then the verifier will handle them as consts and we can init them as a part of the SCX_OPS_LOAD()
or SCX_OPS_ATTACH()
.
For example, there can be const volatile u64 __SCX_ENQ_WAKEUP;
which is initialized during load and then #define SCX_ENQ_WAKEUP __SCX_ENQ_WAKEUP
would make it transparent for the scheduler implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried setting it that way, but there was the issue where the userspace component didn't have access to the vmlinux.h
definitions and so could not set the initial value of the variables. I tried including vmlinux.h
and got a bunch of errors but they must have been due to improperly structuring the header includes - I will go back to that and update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to fail loading if the enums are not available through BTF.
New version that sets all the enums before loading the scheduler. Two points:
|
scheds/c/scx_central.bpf.c
Outdated
|
||
bool timer_pinned = true; | ||
u64 nr_total, nr_locals, nr_queued, nr_lost_pids; | ||
u64 nr_timers, nr_dispatches, nr_mismatches, nr_retries; | ||
u64 nr_overflows; | ||
|
||
SCX_ENUM_DEFINE(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SCX_OPS_LOAD()
already assumes UEI_DEFINE()
, so adding another dependency is just fine. We can add e.g. SCX_COMMON_DEFINE()
to make it easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some minor comments but it's looking pretty good. Thanks. The userspace portion would need to be duplicated in scx_utils
for rust scheds and it'd be nice to have a sanity check on BPF side so that we don't accidentally run with 0 for these enums.
("scx_enq_flags", "SCX_ENQ_REENQ"), | ||
("scx_enq_flags", "SCX_ENQ_LAST"), | ||
("scx_enq_flags", "SCX_ENQ_CLEAR_OPSS"), | ||
("scx_enq_flags", "SCX_ENQ_DSQ_PRIQ"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a bit more complicated but would it be worthwhile to make the script take enum type name only and enumerate all the members automatically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would make maintaining the autogen'ed files significantly easier, but I think it would be better to do it in a separate diff on top because this one is getting on the large side
scheds/c/scx_central.bpf.c
Outdated
@@ -46,6 +46,7 @@ | |||
* Copyright (c) 2022 David Vernet <[email protected]> | |||
*/ | |||
#include <scx/common.bpf.h> | |||
#include <scx/enums.bpf.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make either common.bpf.h
or compat.bpf.h
include this file automatically.
scheds/c/scx_central.c
Outdated
@@ -13,6 +13,7 @@ | |||
#include <libgen.h> | |||
#include <bpf/bpf.h> | |||
#include <scx/common.h> | |||
#include <scx/enums.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
scheds/c/scx_central.c
Outdated
@@ -55,9 +56,11 @@ int main(int argc, char **argv) | |||
signal(SIGTERM, sigint_handler); | |||
restart: | |||
skel = SCX_OPS_OPEN(central_ops, scx_central); | |||
SCX_ENUM_INIT(skel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And make this a part of SCX_OPS_OPEN()
.
* and run it from the root directory to update this file. | ||
*/ | ||
|
||
const volatile u64 __SCX_OPS_NAME_LEN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case this file ends up being included in multiple compilation units, __weak
may be useful.
It might be worth hooking up the script to generate the enums through meson as well. If this is purely for rust schedulers then having the bpf_builder generate the enum could also be rather nice |
I was thinking we can use this script the same way as For Rust I manually generate enum generating lazy static BTF enum reads in |
For the userspace side, it turns out we only need a couple enums - mostly Regarding the sanity check, we could add one specifically for |
Right now the Rust code requires including the new While we could also embed the userspace enum struct in the BPF skeleton, I think it is useful for the schedulers themselves. Right now we manually define in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks!
9bdccdd Merge pull request sched-ext#943 from JakeHillion/pr943 b4b1879 Merge pull request sched-ext#947 from sirlucjan/scx_loader_update f2384fe scx_loader: update docs 198f079 Merge pull request sched-ext#930 from hodgesds/topo-irq 41781fe scx_layered: Add netdev IRQ balancing node support e30e5d8 scx_utils: Add netdev support 8c09ae2 Merge pull request sched-ext#942 from CachyOS/feat/loader-add-flash c258199 replace goto with unrolled loop in antistall_set d5d4f46 scx_loader: add scx_flash as supported scheduler 489ce8a Merge pull request sched-ext#939 from sched-ext/htejun/layered-updates dbcd233 scx_layered: Work around verification failure in antistall_set() on old kernels 61f378c Merge pull request sched-ext#931 from multics69/lavd-osu 88c7d47 Merge pull request sched-ext#934 from sched-ext/htejun/layered-updates aec9e86 Merge branch 'main' into htejun/layered-updates 10bf25a topology, scx_layered: Make --disable-topology handling more consistent ff0e9c6 Merge pull request sched-ext#933 from hodgesds/layered-verifier-nested 1869dd8 scx_layered: Fix verifier issues on older kernels 68e1741 scx_layered: Use cached cpu_ctx->hi_fallback_dsq_id and cpu_ctx->cached_idx 827af0b scx_layered: Fix dsq_id indexing bugs f2c9e7f scx_layered: Don't use tctx->last_cpu when picking target llc 519a27f Merge pull request sched-ext#932 from sched-ext/htejun/layered-updates ce30010 scx_layered: Don't limit antistall execution to layered_cpumask 77eec19 Merge pull request sched-ext#929 from sched-ext/htejun/layered-updates 65b49f8 Merge pull request sched-ext#928 from purplewall1206/patch-1 8e6e3de Merge branch 'main' into patch-1 a7fcda8 Merge pull request sched-ext#924 from sched-ext/scx-fair 5b4b6df Merge branch 'main' into scx-fair 3292be7 scx_lavd: Factor the task's runtime more aggressively in a deadline calculation 56e0dae scx_layered: Fix linter disagreement 93a0bc9 scx_layered: Fix consume_preempting() when --local-llc-iteration 51d4945 scx_layered: Don't call scx_bpf_cpuperf_set() unnecessarily 678b101 scheds: introduce scx_flash c7faf70 fix compile errors 75dd81e scx_layered: Improve topology aware select_cpu() 2b52d17 scx_layered: Encapsulate per-task layered cpumask caching 1293ae2 scx_layered: Stat output format update 66223bf Merge pull request sched-ext#926 from JakeHillion/pr926 d35d527 layered: split out common parts of LayerKind 9016416 Merge pull request sched-ext#925 from hodgesds/layered-lol 1afb7d5 scx_layered: Fix formatting 79125ef Merge pull request sched-ext#919 from hodgesds/layered-dispatch-local 3a3a7d7 Merge branch 'main' into layered-dispatch-local db46e27 Merge pull request sched-ext#923 from hodgesds/layered-dsq-preempt-fix 4fc0509 scx_layered: Add flag to control llc iteration on dispatch 0096c06 scx_layered: Fix cost accounting for dsqs 72f21db Merge pull request sched-ext#922 from hodgesds/layered-cost-dump-fixes 7631049 Merge pull request sched-ext#921 from hodgesds/layered-formatting-fix f7009f7 scx_layered: Fix dump format ff15f25 scx_layered: Fix formatting 6733168 Merge pull request sched-ext#918 from hodgesds/layered-slice-helper 775d09a scx_layered: Consume from local LLCs for dispatch 4fb05d9 Merge pull request sched-ext#920 from hodgesds/layered-consume-fix b2505e7 Merge branch 'main' into layered-consume-fix 1ed387d scx_layered: Fix error in dispatch consumption cad3413 scx_layered: Add helper for layer slice duration 835f0d0 Merge pull request sched-ext#890 from likewhatevs/layered-dsq-timer 89f4aa1 scx_layered: add antistall 38512bf Merge pull request sched-ext#916 from sched-ext/htejun/scx_layered-verifier-workaround bb91ad0 scx_layered: Work around older kernels choking on function calls from sleepable progs 5280206 Merge pull request sched-ext#915 from LohithCV/lavd_doc_err a2e119a scx_lavd: docs: fix typos 007fed0 Merge pull request sched-ext#913 from hodgesds/layered-fallback-dump 3b47782 scx_layered: Add fallback costs to dump 73926d6 Merge pull request sched-ext#912 from hodgesds/layered-mask-cleanup 5ae1b84 Merge pull request sched-ext#908 from JakeHillion/pr908 ee4fd3d scx_layered: Cleanup cpumask 9a282e0 Merge pull request sched-ext#911 from hodgesds/layered-idle-smt-cleanup 637fc3f scx_layered: Use layer idle_smt option f71a9d0 Merge pull request sched-ext#910 from hodgesds/layered-cost-verifier-fix 7db2ef2 scx_layered: Fix verifier issue on older kernels ba54808 layered/topo: lift layer specific checks out of per-LLC loop 218cbea Merge pull request sched-ext#907 from sched-ext/scx-loader-update-bpfland-options 191cc7f scx_loader: tune scx_bpfland default options 416de68 Merge pull request sched-ext#904 from multics69/lavd-drop-padding 56357a7 Merge pull request sched-ext#903 from multics69/lavd-issue-897 d7e1f69 Merge pull request sched-ext#906 from hodgesds/layered-verifier-fix 3cc849f scx_layered: Fix verifier issue when tracing d6ba3b7 Merge pull request sched-ext#896 from hodgesds/layered-dsq-cost 487baa4 scx_layered: Add fallback DSQ cost accounting debe991 Merge pull request sched-ext#905 from likewhatevs/kconfig-cache-update 27a506f add CONFIG_IKCONFIG to ci Kconfig and bump cache ver 22cb9e9 scx_lavd: drop padding in cpdom_cpumask, which was a workaround e9ba2d5 scx_lavd: update cur_logical_clk atomically d0111b3 Merge pull request sched-ext#900 from likewhatevs/enable-iconfig-proc b962ea8 Merge pull request sched-ext#894 from etsal/core_enums 5e35a12 remove stray print 7d44511 fix missing/extraneous newline 4288040 Merge branch 'main' of https://github.com/sched-ext/scx into core_enums de5f2f9 regenerate autogen Rust file f088540 fix linting error in autogenerated code 2f174db use the enum singleton in the userspace scheduler components 1cabed9 Autogenerate enums and BPF enum setters for Rust schedulers d500c50 add autogenerated enum definitions for Rust schedulers fc6ad5c add CONFIG_IKHEADERS_PROC to ci kconfig 479d515 Merge branch 'main' into core_enums 23f302c add SCX_SLICE_* macros to scx_utils and use them for the Rust schedulers c545d23 factor enum handling into existing headers/operations a1d0e7e autogenerate scx enum definitions 31b9fb4 set all enums in userspace before loading ff861d3 introduce CO:RE enum readers and use them for scx_central
9bdccdd Merge pull request sched-ext#943 from JakeHillion/pr943 b4b1879 Merge pull request sched-ext#947 from sirlucjan/scx_loader_update f2384fe scx_loader: update docs 198f079 Merge pull request sched-ext#930 from hodgesds/topo-irq 41781fe scx_layered: Add netdev IRQ balancing node support e30e5d8 scx_utils: Add netdev support 8c09ae2 Merge pull request sched-ext#942 from CachyOS/feat/loader-add-flash c258199 replace goto with unrolled loop in antistall_set d5d4f46 scx_loader: add scx_flash as supported scheduler 489ce8a Merge pull request sched-ext#939 from sched-ext/htejun/layered-updates dbcd233 scx_layered: Work around verification failure in antistall_set() on old kernels 61f378c Merge pull request sched-ext#931 from multics69/lavd-osu 88c7d47 Merge pull request sched-ext#934 from sched-ext/htejun/layered-updates aec9e86 Merge branch 'main' into htejun/layered-updates 10bf25a topology, scx_layered: Make --disable-topology handling more consistent ff0e9c6 Merge pull request sched-ext#933 from hodgesds/layered-verifier-nested 1869dd8 scx_layered: Fix verifier issues on older kernels 68e1741 scx_layered: Use cached cpu_ctx->hi_fallback_dsq_id and cpu_ctx->cached_idx 827af0b scx_layered: Fix dsq_id indexing bugs f2c9e7f scx_layered: Don't use tctx->last_cpu when picking target llc 519a27f Merge pull request sched-ext#932 from sched-ext/htejun/layered-updates ce30010 scx_layered: Don't limit antistall execution to layered_cpumask 77eec19 Merge pull request sched-ext#929 from sched-ext/htejun/layered-updates 65b49f8 Merge pull request sched-ext#928 from purplewall1206/patch-1 8e6e3de Merge branch 'main' into patch-1 a7fcda8 Merge pull request sched-ext#924 from sched-ext/scx-fair 5b4b6df Merge branch 'main' into scx-fair 3292be7 scx_lavd: Factor the task's runtime more aggressively in a deadline calculation 56e0dae scx_layered: Fix linter disagreement 93a0bc9 scx_layered: Fix consume_preempting() when --local-llc-iteration 51d4945 scx_layered: Don't call scx_bpf_cpuperf_set() unnecessarily 678b101 scheds: introduce scx_flash c7faf70 fix compile errors 75dd81e scx_layered: Improve topology aware select_cpu() 2b52d17 scx_layered: Encapsulate per-task layered cpumask caching 1293ae2 scx_layered: Stat output format update 66223bf Merge pull request sched-ext#926 from JakeHillion/pr926 d35d527 layered: split out common parts of LayerKind 9016416 Merge pull request sched-ext#925 from hodgesds/layered-lol 1afb7d5 scx_layered: Fix formatting 79125ef Merge pull request sched-ext#919 from hodgesds/layered-dispatch-local 3a3a7d7 Merge branch 'main' into layered-dispatch-local db46e27 Merge pull request sched-ext#923 from hodgesds/layered-dsq-preempt-fix 4fc0509 scx_layered: Add flag to control llc iteration on dispatch 0096c06 scx_layered: Fix cost accounting for dsqs 72f21db Merge pull request sched-ext#922 from hodgesds/layered-cost-dump-fixes 7631049 Merge pull request sched-ext#921 from hodgesds/layered-formatting-fix f7009f7 scx_layered: Fix dump format ff15f25 scx_layered: Fix formatting 6733168 Merge pull request sched-ext#918 from hodgesds/layered-slice-helper 775d09a scx_layered: Consume from local LLCs for dispatch 4fb05d9 Merge pull request sched-ext#920 from hodgesds/layered-consume-fix b2505e7 Merge branch 'main' into layered-consume-fix 1ed387d scx_layered: Fix error in dispatch consumption cad3413 scx_layered: Add helper for layer slice duration 835f0d0 Merge pull request sched-ext#890 from likewhatevs/layered-dsq-timer 89f4aa1 scx_layered: add antistall 38512bf Merge pull request sched-ext#916 from sched-ext/htejun/scx_layered-verifier-workaround bb91ad0 scx_layered: Work around older kernels choking on function calls from sleepable progs 5280206 Merge pull request sched-ext#915 from LohithCV/lavd_doc_err a2e119a scx_lavd: docs: fix typos 007fed0 Merge pull request sched-ext#913 from hodgesds/layered-fallback-dump 3b47782 scx_layered: Add fallback costs to dump 73926d6 Merge pull request sched-ext#912 from hodgesds/layered-mask-cleanup 5ae1b84 Merge pull request sched-ext#908 from JakeHillion/pr908 ee4fd3d scx_layered: Cleanup cpumask 9a282e0 Merge pull request sched-ext#911 from hodgesds/layered-idle-smt-cleanup 637fc3f scx_layered: Use layer idle_smt option f71a9d0 Merge pull request sched-ext#910 from hodgesds/layered-cost-verifier-fix 7db2ef2 scx_layered: Fix verifier issue on older kernels ba54808 layered/topo: lift layer specific checks out of per-LLC loop 218cbea Merge pull request sched-ext#907 from sched-ext/scx-loader-update-bpfland-options 191cc7f scx_loader: tune scx_bpfland default options 416de68 Merge pull request sched-ext#904 from multics69/lavd-drop-padding 56357a7 Merge pull request sched-ext#903 from multics69/lavd-issue-897 d7e1f69 Merge pull request sched-ext#906 from hodgesds/layered-verifier-fix 3cc849f scx_layered: Fix verifier issue when tracing d6ba3b7 Merge pull request sched-ext#896 from hodgesds/layered-dsq-cost 487baa4 scx_layered: Add fallback DSQ cost accounting debe991 Merge pull request sched-ext#905 from likewhatevs/kconfig-cache-update 27a506f add CONFIG_IKCONFIG to ci Kconfig and bump cache ver 22cb9e9 scx_lavd: drop padding in cpdom_cpumask, which was a workaround e9ba2d5 scx_lavd: update cur_logical_clk atomically d0111b3 Merge pull request sched-ext#900 from likewhatevs/enable-iconfig-proc b962ea8 Merge pull request sched-ext#894 from etsal/core_enums 5e35a12 remove stray print 7d44511 fix missing/extraneous newline 4288040 Merge branch 'main' of https://github.com/sched-ext/scx into core_enums de5f2f9 regenerate autogen Rust file f088540 fix linting error in autogenerated code 2f174db use the enum singleton in the userspace scheduler components 1cabed9 Autogenerate enums and BPF enum setters for Rust schedulers d500c50 add autogenerated enum definitions for Rust schedulers fc6ad5c add CONFIG_IKHEADERS_PROC to ci kconfig 479d515 Merge branch 'main' into core_enums 23f302c add SCX_SLICE_* macros to scx_utils and use them for the Rust schedulers c545d23 factor enum handling into existing headers/operations a1d0e7e autogenerate scx enum definitions 31b9fb4 set all enums in userspace before loading ff861d3 introduce CO:RE enum readers and use them for scx_central
9bdccdd Merge pull request #943 from JakeHillion/pr943 b4b1879 Merge pull request #947 from sirlucjan/scx_loader_update f2384fe scx_loader: update docs 198f079 Merge pull request #930 from hodgesds/topo-irq 41781fe scx_layered: Add netdev IRQ balancing node support e30e5d8 scx_utils: Add netdev support 8c09ae2 Merge pull request #942 from CachyOS/feat/loader-add-flash c258199 replace goto with unrolled loop in antistall_set d5d4f46 scx_loader: add scx_flash as supported scheduler 489ce8a Merge pull request #939 from sched-ext/htejun/layered-updates dbcd233 scx_layered: Work around verification failure in antistall_set() on old kernels 61f378c Merge pull request #931 from multics69/lavd-osu 88c7d47 Merge pull request #934 from sched-ext/htejun/layered-updates aec9e86 Merge branch 'main' into htejun/layered-updates 10bf25a topology, scx_layered: Make --disable-topology handling more consistent ff0e9c6 Merge pull request #933 from hodgesds/layered-verifier-nested 1869dd8 scx_layered: Fix verifier issues on older kernels 68e1741 scx_layered: Use cached cpu_ctx->hi_fallback_dsq_id and cpu_ctx->cached_idx 827af0b scx_layered: Fix dsq_id indexing bugs f2c9e7f scx_layered: Don't use tctx->last_cpu when picking target llc 519a27f Merge pull request #932 from sched-ext/htejun/layered-updates ce30010 scx_layered: Don't limit antistall execution to layered_cpumask 77eec19 Merge pull request #929 from sched-ext/htejun/layered-updates 65b49f8 Merge pull request #928 from purplewall1206/patch-1 8e6e3de Merge branch 'main' into patch-1 a7fcda8 Merge pull request #924 from sched-ext/scx-fair 5b4b6df Merge branch 'main' into scx-fair 3292be7 scx_lavd: Factor the task's runtime more aggressively in a deadline calculation 56e0dae scx_layered: Fix linter disagreement 93a0bc9 scx_layered: Fix consume_preempting() when --local-llc-iteration 51d4945 scx_layered: Don't call scx_bpf_cpuperf_set() unnecessarily 678b101 scheds: introduce scx_flash c7faf70 fix compile errors 75dd81e scx_layered: Improve topology aware select_cpu() 2b52d17 scx_layered: Encapsulate per-task layered cpumask caching 1293ae2 scx_layered: Stat output format update 66223bf Merge pull request #926 from JakeHillion/pr926 d35d527 layered: split out common parts of LayerKind 9016416 Merge pull request #925 from hodgesds/layered-lol 1afb7d5 scx_layered: Fix formatting 79125ef Merge pull request #919 from hodgesds/layered-dispatch-local 3a3a7d7 Merge branch 'main' into layered-dispatch-local db46e27 Merge pull request #923 from hodgesds/layered-dsq-preempt-fix 4fc0509 scx_layered: Add flag to control llc iteration on dispatch 0096c06 scx_layered: Fix cost accounting for dsqs 72f21db Merge pull request #922 from hodgesds/layered-cost-dump-fixes 7631049 Merge pull request #921 from hodgesds/layered-formatting-fix f7009f7 scx_layered: Fix dump format ff15f25 scx_layered: Fix formatting 6733168 Merge pull request #918 from hodgesds/layered-slice-helper 775d09a scx_layered: Consume from local LLCs for dispatch 4fb05d9 Merge pull request #920 from hodgesds/layered-consume-fix b2505e7 Merge branch 'main' into layered-consume-fix 1ed387d scx_layered: Fix error in dispatch consumption cad3413 scx_layered: Add helper for layer slice duration 835f0d0 Merge pull request #890 from likewhatevs/layered-dsq-timer 89f4aa1 scx_layered: add antistall 38512bf Merge pull request #916 from sched-ext/htejun/scx_layered-verifier-workaround bb91ad0 scx_layered: Work around older kernels choking on function calls from sleepable progs 5280206 Merge pull request #915 from LohithCV/lavd_doc_err a2e119a scx_lavd: docs: fix typos 007fed0 Merge pull request #913 from hodgesds/layered-fallback-dump 3b47782 scx_layered: Add fallback costs to dump 73926d6 Merge pull request #912 from hodgesds/layered-mask-cleanup 5ae1b84 Merge pull request #908 from JakeHillion/pr908 ee4fd3d scx_layered: Cleanup cpumask 9a282e0 Merge pull request #911 from hodgesds/layered-idle-smt-cleanup 637fc3f scx_layered: Use layer idle_smt option f71a9d0 Merge pull request #910 from hodgesds/layered-cost-verifier-fix 7db2ef2 scx_layered: Fix verifier issue on older kernels ba54808 layered/topo: lift layer specific checks out of per-LLC loop 218cbea Merge pull request #907 from sched-ext/scx-loader-update-bpfland-options 191cc7f scx_loader: tune scx_bpfland default options 416de68 Merge pull request #904 from multics69/lavd-drop-padding 56357a7 Merge pull request #903 from multics69/lavd-issue-897 d7e1f69 Merge pull request #906 from hodgesds/layered-verifier-fix 3cc849f scx_layered: Fix verifier issue when tracing d6ba3b7 Merge pull request #896 from hodgesds/layered-dsq-cost 487baa4 scx_layered: Add fallback DSQ cost accounting debe991 Merge pull request #905 from likewhatevs/kconfig-cache-update 27a506f add CONFIG_IKCONFIG to ci Kconfig and bump cache ver 22cb9e9 scx_lavd: drop padding in cpdom_cpumask, which was a workaround e9ba2d5 scx_lavd: update cur_logical_clk atomically d0111b3 Merge pull request #900 from likewhatevs/enable-iconfig-proc b962ea8 Merge pull request #894 from etsal/core_enums 5e35a12 remove stray print 7d44511 fix missing/extraneous newline 4288040 Merge branch 'main' of https://github.com/sched-ext/scx into core_enums de5f2f9 regenerate autogen Rust file f088540 fix linting error in autogenerated code 2f174db use the enum singleton in the userspace scheduler components 1cabed9 Autogenerate enums and BPF enum setters for Rust schedulers d500c50 add autogenerated enum definitions for Rust schedulers fc6ad5c add CONFIG_IKHEADERS_PROC to ci kconfig 479d515 Merge branch 'main' into core_enums 23f302c add SCX_SLICE_* macros to scx_utils and use them for the Rust schedulers c545d23 factor enum handling into existing headers/operations a1d0e7e autogenerate scx enum definitions 31b9fb4 set all enums in userspace before loading ff861d3 introduce CO:RE enum readers and use them for scx_central
The values of kernel enums get hardcoded into the BPF scheduler at compile time, which possibly prevents us from deploying the compiled BPF program on kernels with modified values for these enums (as explained in #863). CO:RE methods provide a solution to this by allowing the scheduler to read enums at load time from the running kernel.
Introduce an
scx_enums
struct that is populated at runtime with the enum values from the running kernel, and replace hardcoded enum values in the code with accesses to that struct. This diff demonstrates how to do so in existing schedulers usingscx_central
as a proof of concept.