From d36f2fda1257b946b5d210a63abde2db186849f4 Mon Sep 17 00:00:00 2001 From: Hussein Elnawawy Date: Fri, 21 Feb 2020 16:36:15 -0500 Subject: [PATCH] mem-ruby: Checkpoint from MOESI_hammer Ruby hangs 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 Reviewed-by: John Alsop Maintainer: Bradford Beckmann Tested-by: kokoro --- src/mem/ruby/system/Sequencer.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index a90523e76..f81578700 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -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 -- 2.30.2