scheds: add --completions flag for shell completion generation#3495
Open
kobataiwan wants to merge 2 commits intosched-ext:mainfrom
Open
scheds: add --completions flag for shell completion generation#3495kobataiwan wants to merge 2 commits intosched-ext:mainfrom
kobataiwan wants to merge 2 commits intosched-ext:mainfrom
Conversation
8ecf852 to
d38ed9d
Compare
added 2 commits
March 31, 2026 20:22
Add a hidden --completions <SHELL> flag to all 16 Rust schedulers and scxcash so that distros can auto-generate shell completions at package install time. Supports bash, zsh, fish, elvish, and powershell via clap_complete. The flag is hidden from --help (intended for packaging, not end users) and exits immediately after printing completions — no kernel, BPF, or root required. Usage: scx_bpfland --completions bash > /usr/share/bash-completion/completions/scx_bpfland Fixes: sched-ext#1572 Signed-off-by: Koba Ko <koba.taiwan@gmail.com>
Add a Shell Completions section explaining the --completions flag and a batch install example for all schedulers. Include a test script in scripts/ that validates completions output across all 16 targets. Fixes: sched-ext#1572 Signed-off-by: Koba Ko <koba.taiwan@gmail.com>
8f3abfa to
cb70fd4
Compare
galpt
added a commit
to galpt/scx
that referenced
this pull request
Apr 8, 2026
Localize the common reserved and shared wake paths with per-CPU DSQ lanes while keeping bounded global fallback for fairness and rescue. Move the hottest monitor-only enqueue and dispatch counters to per-CPU aggregation so the common path depends less on shared accounting, and keep the exported metrics surface stable in userspace aggregation. Bump scx_flow to 2.2.0 and add hidden --completions <SHELL> support via clap_complete so the scheduler already matches the shell-completion packaging flow from upstream PR sched-ext#3495 without requiring a later compatibility patch. Validated with cargo fmt/check/clippy -D warnings, the v2.2 benchmark pass, and manual WebGL Aquarium checks at 20000 and 30000 fish.
galpt
added a commit
to galpt/scx
that referenced
this pull request
Apr 8, 2026
Align the v2.2 branch with upstream review guidance from PR sched-ext#3493 by moving scx_flow from scheds/rust into scheds/experimental. Update the workspace entry and keep the moved package build-clean, including the new hidden --completions support added for compatibility with upstream PR sched-ext#3495.
sirlucjan
approved these changes
Apr 10, 2026
Collaborator
|
@kobataiwan Could you rebase on top main? scx_wd40 has been dropped from Cargo.toml/Cargo.lock |
sirlucjan
requested changes
Apr 13, 2026
Collaborator
sirlucjan
left a comment
There was a problem hiding this comment.
Could you rebase on top main?
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.
Summary
--completions <SHELL>flag to all 16 Rust schedulers andscxcashfor distro packaging of shell completions (bash, zsh, fish, elvish, powershell) viaclap_completeDEVELOPER_GUIDE.mdwith batch install examplescripts/test_completions.shto validate completions output across all targetsDetails
The flag is hidden from
--help(intended for distro packagers, not end users) and exits immediately after printing — no kernel, BPF, or root required.Reference:
scxtopalready has this via aGenerateCompletionssubcommand. The schedulers use a simpler hidden flag approach — less invasive, nomain()refactor needed.Targets (16 schedulers + 1 tool)
scx_beerland, scx_bpfland, scx_cake, scx_chaos, scx_cosmos, scx_flash,
scx_lavd, scx_layered, scx_mitosis, scx_p2dq, scx_pandemonium,
scx_rustland, scx_rusty, scx_tickless, scx_wd40, scxcash
Skipped:
scx_rlfifo(no clap dependency),scxtop(already done),xtask/vmlinux_docify(internal build tools)Test plan
--completions bash/zsh/fishproduces valid output and exits 0 on all targets--completionsis hidden from--helpscripts/test_completions.shpasses (110 checks, 0 failures)Fixes: #1572