Repository navigation
fix(x86_64): send the EOI of a preemption IPI that finds no task - #798
Draft
atsushi421 wants to merge 1 commit into
Draft
atsushi421 wants to merge 1 commit into
atsushi421 wants to merge 1 commit into
Conversation
Without the perf feature, the preemption handler returns before `eoi()` if the CPU runs no task. A preemption IPI finds no task if the task of the victim finishes before the IPI arrives. The IPI uses vector 255 with Fixed delivery, so its in-service bit stays set. Then the local APIC blocks every later interrupt, because no vector has a higher priority class. The CPU gets no more wakeup IPIs or timer interrupts and can sleep forever. Now the handler calls `eoi()` before it checks the current task. Signed-off-by: atsushi421 <atsushi.yano.2@tier4.jp>
3 tasks done
This branch has not been deployed
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.
Description
Without the
perffeature, the x86_64 preemption handler returns beforeeoi()if the CPU runs no task. This PR moveseoi()before that check.A preemption IPI finds no task if the task of the victim finishes before the IPI arrives. The IPI uses vector 255 with Fixed delivery, so the missing EOI leaves its in-service bit set. Then the local APIC blocks every later interrupt, because no vector has a higher priority class. The CPU gets no more wakeup IPIs or timer interrupts, and it can sleep forever.
The bug is older than #788. With #788, the EDF scheduler preempts even if the set of the woken task has an idle core. So preemption IPIs, and this race, become more frequent.
Related links
How was this PR tested?
scripts/ci.shpasses on my machine.Notes for reviewers