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

Fix busy waiting on finish_flag #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sacusa
Copy link

@Sacusa Sacusa commented May 11, 2021

If the program that invokes the accelerator loops on the finish_flag instead of waiting for an interrupt, it will likely panic and die. This is caused by the accelerator writing to an uncacheable memory region and the CPU MSHR being unaware of it. Because the finish_flag is uncacheable, the accelerator's write request sets the needsWriteable flag of the memory packet but not the isInvalidate flag. The CPU MSHR, which is not aware of the presence of uncacheable memory, assumes both must be set or neither, triggering the panic.

If the program that invokes the accelerator loops on the `finish_flag` instead of waiting for an interrupt, it will likely panic and die. This is caused by the accelerator writing to an uncacheable memory region and the CPU MSHR being unaware of it. Because the `finish_flag` is uncacheable, the accelerator's write request sets the `needsWriteable` flag of the memory packet but not the `isInvalidate` flag. The CPU MSHR, which is not aware of the presence of uncacheable memory, assumes both must be set or neither, triggering the panic.
Copy link
Member

@xyzsam xyzsam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you share an example where this panic occurs? We have not observed it in any of our current workloads (which can get very large). Also, I don't think the accelerator should be writing to an uncacheable region, nor should it need to. The only requirement is that the CPU refer to it as a volatile int so that it's always reloaded from memory.

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