kernel: Check for interrupts and deferred calls #1808
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.
Pull Request Overview
This pull request changes the do_process loop to
break
(and stop running a process) if either:Before, this only happened on a pending interrupt.
Without this change, applications take priority over pending dynamic deferred calls. This is most noticeable with virtualized uart. If an app calls a syscall that tries to transmit a buffer over uart, the virtual uart mux enqueues a deferred call. That is not an interrupt, so the process loop continues and likely the process may be re-executed. The deferred call will not be executed until the process yields or exhausts its timeslice.
Testing Strategy
I found this on the arty-e21 board which does not have a systick implementation. I tried to use strace, and it didn't display anything. The board turned out to be crashing, so deferred calls were never serviced.
If you want to see this on hail:
whileone
app.The strace printouts won't happen. If you use process console to generate an interrupt then they will get printed.
TODO or Help Wanted
n/a
Documentation Updated
/docs
, or no updates are required.Formatting
make formatall
.