{bp-19972} sched/sporadic: fix policy switch and cross-task setparam - #20074
Merged
Conversation
…ADIC The policy flag bits were cleared before the switch statement, so the checks testing whether the task was previously SCHED_SPORADIC could never be true. As a result nxsched_stop_sporadic() was never called when a sporadic task switched to SCHED_FIFO/SCHED_RR, leaking the sporadic state, and a sporadic-to-sporadic reconfiguration ran initialize instead of reset. Clear the policy flag bits only after the previous policy has been evaluated, right before the new policy bits are set. Signed-off-by: yushuailong <yyyusl@qq.com>
set_sporadic_param() tested rtcb (the calling task) instead of tcb (the task being modified). A cross-task sched_setparam() therefore either skipped the sporadic parameter update entirely or, when the calling task was itself sporadic, reset a task that had no sporadic state. Use tcb consistently and drop the now-unused rtcb argument. Signed-off-by: yushuailong <yyyusl@qq.com>
jerpelea
requested review from
GUIDINGLI,
anchao and
xiaoxiang781216
as code owners
September 7, 2026 08:23
cederom
approved these changes
Sep 7, 2026
Contributor
Author
|
CI fix |
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
This PR fixes two bugs in the SCHED_SPORADIC handling of the scheduler, both found while testing sporadic policy switching:
Impact
RELEASE
Testing
CI