-
Notifications
You must be signed in to change notification settings - Fork 1.4k
mem-ruby: Prevent LL/SC livelock in MESI protocols (#1384) #1399
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm giving this a cautious approval. I would like someone with experience with MESI to also approve before merging.
MESI_Two_Level and MESI_Three_Level protocols are susceptible to LL/SC livelocks when simulating boards with high core count. This fix is based on MOESI_CMP_directory's implementation of locked states, but tailors the solution to only apply it when a Load-Linked is initiated. There are two new states to act as locked states and stall any messages leading to eviction: * LLSC_E: equivalent to E state, go to E after timeout. * LLSC_M: equivalent to M state, go to M after timeout. The main new event is Load_Linked, which is very similar (in behavior) to a Store, reusing several transient states. When a controller receives the exclusive data, it differentiates a Load_Linked from a Store by checking a new field added to the TBE: 'isLoadLinked'. It triggers a different event when it is a Load_Linked, which in turn causes the transition to one of the locked states. The entire mechanism can be turned off by setting 'use_llsc_lock' to false, and the amount of time to keep locked is defined by 'llsc_lock_timeout_latency'. Change-Id: I13f415b6b7890d51d01f23001047d2363467a814
79288ba
to
49a7b7a
Compare
Looks OK to me. Since it was an Arm bug, @giactra may want to take a look. |
Hi @giactra, since this change is related to ARM, you might want to review it. |
Thanks @ivanaamit ; you might have tagged the wrong Giacomo though ;) |
Hi @giactra, if you have time, we’d appreciate it if you could review this PR. Even a quick review would be very helpful. Thank you! |
@giactra : This affects ARM. Could you review this? We're ready to merge but would appreciate ARM approval. |
Fix #1384.
MESI_Two_Level and MESI_Three_Level protocols are susceptible to LL/SC livelocks when simulating boards with high core count.
This fix is based on MOESI_CMP_directory's implementation of locked states, but tailors the solution to only apply it when a Load-Linked is initiated.
There are two new states to act as locked states and stall any messages leading to eviction:
The main new event is Load_Linked, which is very similar (in behavior) to a Store, reusing several transient states. When a controller receives the exclusive data, it differentiates a Load_Linked from a Store by checking a new field added to the TBE: 'isLoadLinked'. It triggers a different event when it is a Load_Linked, which in turn causes the transition to one of the locked states.
The entire mechanism can be turned off by setting 'use_llsc_lock' to false, and the amount of time to keep locked is defined by 'llsc_lock_timeout_latency'.
Change-Id: I13f415b6b7890d51d01f23001047d2363467a814