Repository navigation
mips: fold the IP7 ticket module back into mips_core - #799
Open
jamesbraid wants to merge 1 commit into
Open
jamesbraid wants to merge 1 commit into
jamesbraid wants to merge 1 commit into
Conversation
A timer callback delivers IP7 in two steps on two words: it claims the armed ticket, then sets IP7 in the pending word. A Compare write issues a new ticket and clears IP7. With only "armed" and "consumed" in the ticket word, a callback that had claimed the old ticket could set IP7 after the write had cleared it, and the guest saw a timer interrupt for a deadline it had just replaced. 8b4b6ba closed that with a third state, held from the claim until IP7 is set, which a Compare write waits out. That fix put the word in a module of its own, behind closures, so a loom model could drive it. The model could not use the real pending word, which is a std atomic that compiled code reads, so it checked the ticket word against a copy of the two closures and of the Compare write's order. The module, its wrappers and the model were about 170 lines for a protocol that is one extra state. Keep the state and drop the rest. claim_ip7 and arm_ip7_sequence hold the protocol directly, as they did before, and the Compare write takes its ticket at the top again. The new test runs the real claim_ip7 on one thread against real Compare writes on another and checks IP7 after both finish. With the third state removed it failed 60 runs of 60 on two or more CPUs, and it passed 250 of 250 with it. Pinned to one CPU it passed 20 of 20 without the state, so it only catches a regression on a multiprocessor host.
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.
A timer callback delivers IP7 in two steps on two words: it claims the
armed ticket, then sets IP7 in the pending word. A Compare write issues
a new ticket and clears IP7. With only "armed" and "consumed" in the
ticket word, a callback that had claimed the old ticket could set IP7
after the write had cleared it, and the guest saw a timer interrupt for
a deadline it had just replaced. 8b4b6ba closed that with a third
state, held from the claim until IP7 is set, which a Compare write waits
out.
That fix put the word in a module of its own, behind closures, so a loom
model could drive it. The model could not use the real pending word,
which is a std atomic that compiled code reads, so it checked the ticket
word against a copy of the two closures and of the Compare write's
order. The module, its wrappers and the model were about 170 lines for a
protocol that is one extra state.
Keep the state and drop the rest. claim_ip7 and arm_ip7_sequence hold
the protocol directly, as they did before, and the Compare write takes
its ticket at the top again. The new test runs the real claim_ip7 on one
thread against real Compare writes on another and checks IP7 after both
finish. With the third state removed it failed 60 runs of 60 on two or
more CPUs, and it passed 250 of 250 with it. Pinned to one CPU it passed
20 of 20 without the state, so it only catches a regression on a
multiprocessor host.