mem-ruby: Checkpoint from MOESI_hammer Ruby hangs
authorHussein Elnawawy <hussein.elnawawy@gmail.com>
Fri, 21 Feb 2020 21:36:15 +0000 (16:36 -0500)
committerHussein Elnawawy <hussein.elnawawy@gmail.com>
Thu, 26 Mar 2020 22:23:59 +0000 (22:23 +0000)
Fix MOESI_hammer checkpoint hanging.
The function markRemoved() should be called before hitCallback(),
not after it. The reason is that hitCallback() checks if draining is
complete based on the value of "m_outstanding_count". And since
markRemoved() is responsible for decrementing "m_outstanding_count",
hitCallback() does not see that there are no outstanding requests.

Reported by: Timothy Hayes
Jira: https://gem5.atlassian.net/browse/GEM5-331
Change-Id: I14c34be79843b172ae994ab1792fe4ce6cf5cf6e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25683
Reviewed-by: Timothy Hayes <timothy.hayes@arm.com>
Reviewed-by: John Alsop <johnathan.alsop@amd.com>
Maintainer: Bradford Beckmann <brad.beckmann@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/ruby/system/Sequencer.cc

index a90523e7691831192485940609a5c3f62de061e7..f81578700372f67b5813f02d7b09f9b44ac27838 100644 (file)
@@ -360,20 +360,22 @@ Sequencer::writeCallback(Addr address, DataBlock& data,
             } else {
                 aliased_stores++;
             }
+            markRemoved();
+            ruby_request = false;
             hitCallback(&seq_req, data, success, mach, externalHit,
                         initialRequestTime, forwardRequestTime,
                         firstResponseTime);
         } else {
             // handle read request
             assert(!ruby_request);
+            markRemoved();
+            ruby_request = false;
             aliased_loads++;
             hitCallback(&seq_req, data, true, mach, externalHit,
                         initialRequestTime, forwardRequestTime,
                         firstResponseTime);
         }
         seq_req_list.pop_front();
-        markRemoved();
-        ruby_request = false;
     }
 
     // free all outstanding requests corresponding to this address
@@ -421,12 +423,12 @@ Sequencer::readCallback(Addr address, DataBlock& data,
                               initialRequestTime, forwardRequestTime,
                               firstResponseTime);
         }
+        markRemoved();
+        ruby_request = false;
         hitCallback(&seq_req, data, true, mach, externalHit,
                     initialRequestTime, forwardRequestTime,
                     firstResponseTime);
         seq_req_list.pop_front();
-        markRemoved();
-        ruby_request = false;
     }
 
     // free all outstanding requests corresponding to this address