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

Change subject: mem-cache: Prune unnecessary writebacks in exclusive caches
......................................................................

mem-cache: Prune unnecessary writebacks in exclusive caches

Exclusive caches use the tempBlock to fill for responses from a
downstream cache. The reason for this is that they only pass the block
to the cache above without keeping a copy. When all requests are
serviced the block is immediately invalidated unless it is dirty, in
which case it has to be written back to the memory below.

To avoid unnecessary writebacks, this changeset forces mostly
exclusive caches to issuse requests that can only fetch clean data
when possible.

Reported-by: Quereshi Muhammad Avais <[email protected]>

Change-Id: I01b377563f5aa3e12d22f425a04db7c023071849
Reviewed-by: Andreas Sandberg <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/5061
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Nikos Nikoleris <[email protected]>
---
M src/mem/cache/cache.cc
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Nikos Nikoleris: Looks good to me, approved



diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc
index a83f8ab..421fa5b 100644
--- a/src/mem/cache/cache.cc
+++ b/src/mem/cache/cache.cc
@@ -1021,8 +1021,18 @@
         cmd = MemCmd::SCUpgradeFailReq;
     } else {
         // block is invalid
+
+        // If the request does not need a writable there are two cases
+        // where we need to ensure the response will not fetch the
+        // block in dirty state:
+        // * this cache is read only and it does not perform
+        //   writebacks,
+        // * this cache is mostly exclusive and will not fill (since
+        //   it does not fill it will have to writeback the dirty data
+        //   immediately which generates uneccesary writebacks).
+ bool force_clean_rsp = isReadOnly || clusivity == Enums::mostly_excl;
         cmd = needsWritable ? MemCmd::ReadExReq :
-            (isReadOnly ? MemCmd::ReadCleanReq : MemCmd::ReadSharedReq);
+ (force_clean_rsp ? MemCmd::ReadCleanReq : MemCmd::ReadSharedReq);
     }
     PacketPtr pkt = new Packet(cpu_pkt->req, cmd, blkSize);


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

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

Reply via email to