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

i#5843 scheduler: Add direct thread switch support #6424

Merged
merged 4 commits into from
Nov 12, 2023

Conversation

derekbruening
Copy link
Contributor

@derekbruening derekbruening commented Nov 8, 2023

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

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 simple unit test.

Issue: #5843
@derekbruening
Copy link
Contributor Author

ub22 x32 failure is off.simple #6416
win64 failures: replaceall #5412, api.dis/decenc #6411
win32 failures: floatpc #2267

clients/drcachesim/scheduler/scheduler.h Show resolved Hide resolved
clients/drcachesim/tests/scheduler_unit_tests.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/scheduler_unit_tests.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/scheduler_unit_tests.cpp Outdated Show resolved Hide resolved
Added 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).

Improved the test to a single-core test with timestamp deps where the
schedule would more clearly be different without the switch target.
@derekbruening
Copy link
Contributor Author

Wow, no flaky failures!

@derekbruening derekbruening merged commit 568aef5 into master Nov 12, 2023
15 checks passed
@derekbruening derekbruening deleted the i5843-direct-switch branch November 12, 2023 01:24
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