mem-ruby: Fix deadlock in VIPERCoalescer
authorKyle Roarty <kyleroarty1716@gmail.com>
Tue, 10 Nov 2020 06:36:05 +0000 (00:36 -0600)
committerKyle Roarty <kyleroarty1716@gmail.com>
Tue, 17 Nov 2020 17:08:24 +0000 (17:08 +0000)
Certain instructions (some atomics and buffer_wbinvl1_vol) deadlock
in the coalescer, where sendTimingReq fails, fails a retry, and then
never retries again.

This fix sets m_cache_inv_pkt to null before calling
completeHitCallback(), as that allows the failed packets to be retried
again.

Change-Id: I4a51c741360f385f8b4c3f2a31a9410f18e095d9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/37477
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/ruby/system/VIPERCoalescer.cc

index 111f9f22b5417a040b4cabf695bc5d0f132b5a0c..1aea4a36433b897decbc4e927c4bad7e3473a8db 100644 (file)
@@ -269,8 +269,8 @@ VIPERCoalescer::invTCPCallback(Addr addr)
 
     if (m_num_pending_invs == 0) {
         std::vector<PacketPtr> pkt_list { m_cache_inv_pkt };
-        completeHitCallback(pkt_list);
         m_cache_inv_pkt = nullptr;
+        completeHitCallback(pkt_list);
     }
 }