Nikos Nikoleris has submitted this change and it was merged. ( https://gem5-review.googlesource.com/11016 )

Change subject: mem-cache: Fix promoting of targets that need writable
......................................................................

mem-cache: Fix promoting of targets that need writable

There are cases where a request which does not need a writable copy
gets an response upgraded reponse and fills in a writable copy. When
this happens, we promote deferred MSHR targets that were deferred
because they needed a writable copy to service them immediately.

Previously, we would uncoditionally promote deferred targets. Since
the deferred targets might contain a cache invalidation operation, we
have to make sure that any targets following the cache invalidation is
not promoted.

Change-Id: I1f7b28f7d35f84329e065c8f63117db21852365a
Reviewed-on: https://gem5-review.googlesource.com/11016
Reviewed-by: Daniel Carvalho <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
---
M src/mem/cache/mshr.cc
M src/mem/cache/mshr.hh
2 files changed, 21 insertions(+), 4 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Daniel Carvalho: Looks good to me, approved



diff --git a/src/mem/cache/mshr.cc b/src/mem/cache/mshr.cc
index d6208dd..8ef8a2c 100644
--- a/src/mem/cache/mshr.cc
+++ b/src/mem/cache/mshr.cc
@@ -566,10 +566,20 @@
         // if any of the deferred targets were upper-level cache
         // requests marked downstreamPending, need to clear that
         assert(!downstreamPending);  // not pending here anymore
-        deferredTargets.clearDownstreamPending();
-        // this clears out deferredTargets too
-        targets.splice(targets.end(), deferredTargets);
-        deferredTargets.resetFlags();
+
+        auto last_it = std::find_if(
+            deferredTargets.begin(), deferredTargets.end(),
+            [](MSHR::Target &t) {
+                assert(t.source == Target::FromCPU);
+                return t.pkt->req->isCacheInvalidate();
+            });
+        deferredTargets.clearDownstreamPending(deferredTargets.begin(),
+                                               last_it);
+        targets.splice(targets.end(), deferredTargets,
+                       deferredTargets.begin(), last_it);
+        // We need to update the flags for the target lists after the
+        // modifications
+        deferredTargets.populateFlags();
     }
 }

diff --git a/src/mem/cache/mshr.hh b/src/mem/cache/mshr.hh
index f93d3c0..71c2da2 100644
--- a/src/mem/cache/mshr.hh
+++ b/src/mem/cache/mshr.hh
@@ -385,6 +385,13 @@

     bool promoteDeferredTargets();

+    /**
+     * Promotes deferred targets that do not require writable
+     *
+     * Requests in the deferred target list are moved to the target
+     * list up until the first target that is a cache maintenance
+     * operation or needs a writable copy of the block
+     */
     void promoteWritable();

     bool checkFunctional(PacketPtr pkt);

--
To view, visit https://gem5-review.googlesource.com/11016
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I1f7b28f7d35f84329e065c8f63117db21852365a
Gerrit-Change-Number: 11016
Gerrit-PatchSet: 3
Gerrit-Owner: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to