Nikos Nikoleris has submitted this change and it was merged. (
https://gem5-review.googlesource.com/5048 )
Change subject: mem: Promote deferred targets only when the block is valid
......................................................................
mem: Promote deferred targets only when the block is valid
When a response indicates that there are no other sharers of the
block, the cache can promote its copy of the block to writable and
potential service deferred targets even if the request didn't ask for
a writable copy.
Previously, a response would guarantee the presence of the block in
the cache. A response could either be filling, upgrading or a response
to an invalidation due to a pending whole line write. Responses to
cache maintenance invalidations break this assumption. This change
adds an extra check to make sure that the block was already valid or
that the response is filling before promoting the block.
Change-Id: I6839f683a05d4dad4205c23f365a925b7b05e366
Reviewed-by: Curtis Dunham <[email protected]>
Reviewed-by: Anouk Van Laer <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/5048
Maintainer: Nikos Nikoleris <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
---
M src/mem/cache/cache.cc
1 file changed, 8 insertions(+), 7 deletions(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved
Anouk Van Laer: Looks good to me, but someone else must approve
Nikos Nikoleris: Looks good to me, approved
diff --git a/src/mem/cache/cache.cc b/src/mem/cache/cache.cc
index 97df562..48974c7 100644
--- a/src/mem/cache/cache.cc
+++ b/src/mem/cache/cache.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2016 ARM Limited
+ * Copyright (c) 2010-2017 ARM Limited
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
@@ -1336,16 +1336,17 @@
Tick forward_time = clockEdge(forwardLatency) + pkt->headerDelay;
- // upgrade deferred targets if the response has no sharers, and is
- // thus passing writable
- if (!pkt->hasSharers()) {
- mshr->promoteWritable();
- }
-
bool is_fill = !mshr->isForward &&
(pkt->isRead() || pkt->cmd == MemCmd::UpgradeResp);
CacheBlk *blk = tags->findBlock(pkt->getAddr(), pkt->isSecure());
+ const bool valid_blk = blk && blk->isValid();
+ // If the response indicates that there are no sharers and we
+ // either had the block already or the response is filling we can
+ // promote our copy to writable
+ if (!pkt->hasSharers() && (is_fill || valid_blk)) {
+ mshr->promoteWritable();
+ }
if (is_fill && !is_error) {
DPRINTF(Cache, "Block for addr %#llx being updated in Cache\n",
--
To view, visit https://gem5-review.googlesource.com/5048
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: I6839f683a05d4dad4205c23f365a925b7b05e366
Gerrit-Change-Number: 5048
Gerrit-PatchSet: 4
Gerrit-Owner: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: Anouk Van Laer <[email protected]>
Gerrit-Reviewer: Curtis Dunham <[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