i#5843 scheduler: Add direct thread switch support #6424
Merged
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.
Adds support for the TRACE_MARKER_TYPE_DIRECT_THREAD_SWITCH marker, when it appears after TRACE_MARKER_TYPE_MAYBE_BLOCKING_SYSCALL. The scheduler directly switches to the target thread if it is on the ready queue. Performing a forced migration if the target is running on another output is not yet implemented. Once i/o wait states are added, waking up a target thread will be added, but that is future work as well.
Adds a DEPENDENCY_DIRECT_SWITCH_BITFIELD and renamed DEPENDENCY_TIMESTAMPS
to DEPENDENCY_TIMESTAMP_BITFIELD so we can combine them, and made a new
enum entry DEPENDENCY_TIMESTAMPS which combines the two bitfields, which is
what nearly every use case should want while still giving us control and
without really breaking compatibility (and by providing bits and
combinations the enum type is all that's needed still).
Adds a unit test where the schedule would clearly be different without the switch target.
Issue: #5843