Skip to content
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

scx_rustland_core: small core design improvements #568

Merged
merged 4 commits into from
Aug 26, 2024

Conversation

arighi
Copy link
Contributor

@arighi arighi commented Aug 26, 2024

Small design improvements, mostly focused at enhancing scx_rustland_core usability.

API changes:

  • temporarily dropped RL_PREEMPT_CPU (preemption will be re-added later with a better design)
  • allow to specify a vtime in DispatchedTask (the vtime will be passed to scx_bpf_dispatched_vtime())

Misc Improvements:

  • scx_rlfifo: refactoring to make the code more suitable to be used as a generic template
  • include the FIFO code in the README.md of scx_rustland_core (in this way the README can be used standalone as a guide on how to implement schedulers using scx_rustland_core)

Temporarily drop the RL_PREEMPT_CPU flag, we need a better way to
implement preemption in scx_rustland_core and it's not very effective at
the moment, so simply it drop it for now (it'll be re-added later in the
future in a proper way).

This change does not affect any scheduler, since RL_PREEMPT_CPU is
currently unused.

Signed-off-by: Andrea Righi <[email protected]>
Introduce a vtime attribute to struct DispatchedTask that can be set by
the user-space scheduler and it'll be use by the BPF component to
dispatch the task via scx_bpf_dispatch_vtime().

In this way a user-space scheduler can decide to apply its own internal
task ordering or rely on the BPF vtime priority DSQs (or both).

Signed-off-by: Andrea Righi <[email protected]>
Refactor the code design to make it more suitable as a template for
implementing advanced scheduling policies.

In particular, create separate loops for task consumption and task
dispatching. This will make the scheduler easier to adapt as a
foundation for implementing more complex scheduling policies.

Signed-off-by: Andrea Righi <[email protected]>
Include the FIFO example directly in the README.md, instead of linking
scx_rlfifo.

Including the example directly in the README can be more useful and
practical in those cases where internet access is not available or when
we need to distribute a more "standalone" documentation.

Signed-off-by: Andrea Righi <[email protected]>
@arighi
Copy link
Contributor Author

arighi commented Aug 26, 2024

CI is failing for unrelated reasons (maybe systems on github are a bit busy?). Merging for now, instead of restarting the failed CI jobs.

@arighi arighi merged commit 35db89e into main Aug 26, 2024
1 of 2 checks passed
@arighi arighi deleted the rustland-core-design-improv branch August 26, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants