Repository navigation
scx_loader: Allow custom schedulers defined in the config - #81
Merged
vnepogodin merged 1 commit intoOct 29, 2026
Merged
Conversation
scx_loader can only run the schedulers in SupportedSched. Running a scheduler that isn't upstream yet, for example one under development, means patching that enum. Add an opt-in allow_custom_scheds config option. With it set, a [scheds.NAME] entry with an absolute `path` defines a custom scheduler, with the same mode fields as a built-in one. NAME must be `scx_` followed by lowercase letters, digits or `_`, and must not be built in. A `path` without the option is a config error rather than being ignored. The binary path only ever comes from the root-owned config. Over D-Bus a custom scheduler is picked by name, through the existing methods, and a name the config doesn't define is rejected before the polkit check. Built-in schedulers still run by name from PATH. SupportedSched gets a Custom(String) variant and is serialized as its name, so the D-Bus signature stays "s" and existing clients keep working. SupportedSchedulers lists the custom schedulers after the built-in ones. Because a Custom value can't produce a &'static str, the From<SupportedSched> for &str impl is replaced by as_str(). Debug still prints built-in schedulers as before, so scxctl's output doesn't change. A [scheds.NAME] entry without a `path` for a name scx_loader doesn't know is still accepted and ignored, as before, so configs that list a scheduler scx_loader no longer ships keep loading. Link: sched-ext#34 Signed-off-by: Mohit Mishra <immadmohit@gmail.com>
Contributor
Author
|
Can you @vnepogodin @sirlucjan please review this PR? |
sirlucjan
approved these changes
Oct 25, 2026
Contributor
Author
|
@sirlucjan @vnepogodin I see both of you approved this, can this be merged as I don't have merge access |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scx_loader can only run the schedulers listed in
SupportedSched. To run one that isn't upstream yet, for example a scheduler under development, you have to patch that enum (#34).This adds an opt-in
allow_custom_schedsoption, off by default. With it set, a[scheds.NAME]entry with an absolutepathdefines a custom scheduler. The mode fields work the same as for a built-in one:scx_followed by lowercase letters, digits or_, and can't be a built-in scheduler.pathwithoutallow_custom_scheds = trueis a config error, so the setting is never silently ignored.SupportedSchedulersafter the built-in ones, and can be used anywhere a built-in one can, includingdefault_sched.SupportedSchedgets aCustom(String)variant and is serialized as its name. The D-Bus signature stayss, so existing clients keep working. ACustomvalue can't produce a&'static str, soFrom<SupportedSched> for &stris replaced byas_str().Debugstill prints built-in schedulers as before, so scxctl's output doesn't change.A
[scheds.NAME]entry without apathfor a name scx_loader doesn't know is still accepted and ignored, so configs that list a scheduler scx_loader no longer ships keep loading.Closes #34