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#6471 sched idle: Add idle time from blocking syscalls #6494

Merged
merged 6 commits into from
Dec 7, 2023

Conversation

derekbruening
Copy link
Contributor

Adds a longer waiting period on blocking syscalls using either provided output time or for instruction-based quanta a count of queue selections before a blocked input is actually selected. Since the scheduler does not have timer interrupts or regular points of control and relies on its user calling it, idle inputs are kept on the ready queue and are checked for becoming unblocked when the ready queue is queried.

The wait duration is set based on the "wait time factor" which is the syscall latency divided by the context switch threshold multipled by a user-provided "block_time_scale" option which can be used to scale up or down the durations.

The wait duration is erased on a direct switch to an input.

Adds a new replay record type to represent idle time on replay.

Augments the unit tests to include blocking high-latency syscalls to test the new feature in various sub-tests.

Issue: #6471

Adds a longer waiting period on blocking syscalls using either
provided output time or for instruction-based quanta a count of queue
selections before a blocked input is actually selected.  Since the
scheduler does not have timer interrupts or regular points of control
and relies on its user calling it, idle inputs are kept on the ready
queue and are checked for becoming unblocked when the ready queue is
queried.

The wait duration is set based on the "wait time factor" which is the
syscall latency divided by the context switch threshold multipled by a
user-provided "block_time_scale" option which can be used to scale up
or down the durations.

The wait duration is erased on a direct switch to an input.

Adds a new replay record type to represent idle time on replay.

Augments the unit tests to include blocking high-latency syscalls to
test the new feature in various sub-tests.

Issue: #6471
clients/drcachesim/scheduler/scheduler.cpp Show resolved Hide resolved
clients/drcachesim/scheduler/scheduler.h Show resolved Hide resolved
clients/drcachesim/scheduler/scheduler.h Outdated Show resolved Hide resolved
clients/drcachesim/scheduler/scheduler.cpp Show resolved Hide resolved
@derekbruening
Copy link
Contributor Author

In further testing on large traces, I am actually having trouble getting enough idle time. I can get a number of idle periods but they never add up to a large % of the instruction count. (With large core count I can get plenty of idle time.). I can't get arbitrary idle times by raising the scale: the scheduler gets slow before I reach idle % targets. But, I think it is worth merging this as-is for now to get some base blocked-idle time in there for base testing, even if I figure out how to improve it later.

@derekbruening
Copy link
Contributor Author

x32 is amd #6417
win64 is windows-timestamps callback.c assert #6081

@derekbruening derekbruening merged commit 110ca5e into master Dec 7, 2023
13 of 15 checks passed
@derekbruening derekbruening deleted the i6471-wait-when-block branch December 7, 2023 04:32
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