mem: Fix SenderState related cache deadlock
Review Request #1725 - Created Feb. 13, 2013 and submitted
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 9542:563280b8bbc2 --------------------------- mem: Fix SenderState related cache deadlock This patch fixes a potential deadlock in the caches. This deadlock could occur when more than one cache is used in a system, and pkt->senderState is modified in between the two caches. This happened as the caches relied on the senderState remaining unchanged, and used it for instantaneous upstream communication with other caches. This issue has been addressed by iterating over the linked list of senderStates until we are either able to cast to a MSHR* or senderState is NULL. If the cast is successful, we know that the packet has previously passed through another cache, and therefore update the downstreamPending flag accordingly. Otherwise, we do nothing.
All regressions passing (excluding t1000 and eio)
Ship It!
Posted (Feb. 16, 2013, 2:46 a.m.)
Hi Andreas, This looks OK to me. One optional enhancement would be to package the loop into a function (maybe a static method on MSHR) that returns an MSHR* (or NULL), such that you could just do a drop-in replacement for the line MSHR *mshr = dynamic_cast<MSHR*>(pkt->senderState); in both places it occurs with a single line like MSHR *mshr = findNextMSHR(pkt->senderState);
Review request changed
Updated (Feb. 17, 2013, 9:39 p.m.)
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+30 -2) |
Thanks!
