mem-cache: Selectively clear downstream pending
authorNikos Nikoleris <nikos.nikoleris@arm.com>
Sat, 17 Mar 2018 00:22:23 +0000 (00:22 +0000)
committerNikos Nikoleris <nikos.nikoleris@arm.com>
Fri, 22 Jun 2018 17:39:16 +0000 (17:39 +0000)
Until now, all deferred targets of an MSHR would be promoted together
as soon as the targets were serviced. When we promote deferred targets
we also clear the downstreamPending flag.

Due to the way we handle cache clean operations we might need to
promote only deferred targets that don't require writable, leaving
some targets as deferred. To allow for partial target promotion, this
change adds support for clearing the downstreamPending only for a
subset of a TargetsList.

Change-Id: Id06953643ba9a975ebacc76ac10215441e264e74
Reviewed-on: https://gem5-review.googlesource.com/11015
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

src/mem/cache/mshr.cc
src/mem/cache/mshr.hh

index 21ce8a36d1f94b6d7e0fc49a7437fbd34082f935..d6208dde97621166195726b55fd32ab5f9b3c19c 100644 (file)
@@ -179,25 +179,32 @@ MSHR::TargetList::replaceUpgrades()
 
 
 void
-MSHR::TargetList::clearDownstreamPending()
+MSHR::TargetList::clearDownstreamPending(MSHR::TargetList::iterator begin,
+                                         MSHR::TargetList::iterator end)
 {
-    for (auto& t : *this) {
-        if (t.markedPending) {
+    for (auto t = begin; t != end; t++) {
+        if (t->markedPending) {
             // Iterate over the SenderState stack and see if we find
             // an MSHR entry. If we find one, clear the
             // downstreamPending flag by calling
             // clearDownstreamPending(). This recursively clears the
             // downstreamPending flag in all caches this packet has
             // passed through.
-            MSHR *mshr = t.pkt->findNextSenderState<MSHR>();
+            MSHR *mshr = t->pkt->findNextSenderState<MSHR>();
             if (mshr != nullptr) {
                 mshr->clearDownstreamPending();
             }
-            t.markedPending = false;
+            t->markedPending = false;
         }
     }
 }
 
+void
+MSHR::TargetList::clearDownstreamPending()
+{
+    clearDownstreamPending(begin(), end());
+}
+
 
 bool
 MSHR::TargetList::checkFunctional(PacketPtr pkt)
index 5c5a9e8d13af15fff7ee9e0a4444988f4bcbfd26..f93d3c0f58476886494557de0e7c5a9c5b5258dc 100644 (file)
@@ -234,6 +234,7 @@ class MSHR : public QueueEntry, public Printable
         void replaceUpgrades();
 
         void clearDownstreamPending();
+        void clearDownstreamPending(iterator begin, iterator end);
         bool checkFunctional(PacketPtr pkt);
         void print(std::ostream &os, int verbosity,
                    const std::string &prefix) const;