From 12cf816745fa9fe2718e54d19b33f303b15b90aa Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Wed, 2 Oct 2019 13:40:51 +0100 Subject: mem-cache: Avoid promotion of incompatible deferred targets Often a request that hits on an MSHR has to be deferred as it can't be serviced by the current response. For example, a request that requires writable has to be deferred when the response is expected to bring in a read-only copy of the block. However, there are cases where the response, although not expected to do so, brings a writable copy and as a result we also service deferred targets. In such cases, we promote deferred targets up until the first that can't be serviced by the current response (e.g., cache maintainance operation). If the first deferred target is incompatible we don't promote any targets at all. Change-Id: Ib3e13be51120b7c0f0053b83b76bde03e1b7dd4e Signed-off-by: Nikos Nikoleris Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22127 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Reviewed-by: Daniel Carvalho Maintainer: Jason Lowe-Power --- src/mem/cache/mshr.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mem/cache/mshr.cc b/src/mem/cache/mshr.cc index 13a50169c..4241fa375 100644 --- a/src/mem/cache/mshr.cc +++ b/src/mem/cache/mshr.cc @@ -612,8 +612,10 @@ MSHR::promoteReadable() void MSHR::promoteWritable() { + PacketPtr def_tgt_pkt = deferredTargets.front().pkt; if (deferredTargets.needsWritable && - !(hasPostInvalidate() || hasPostDowngrade())) { + !(hasPostInvalidate() || hasPostDowngrade()) && + !def_tgt_pkt->req->isCacheInvalidate()) { // We got a writable response, but we have deferred targets // which are waiting to request a writable copy (not because // of a pending invalidate). This can happen if the original -- cgit v1.2.3