Daecheol You has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/63611?usp=email )

Change subject: mem-ruby: bug fix for stale WriteBack
......................................................................

mem-ruby: bug fix for stale WriteBack

Finish_CopyBack_Stale is scheduled only when the requestor is the last
sharer. This prevents the cacahe evicting the line which was already
evicted while the stale WriteBack transaction was stalled.
Wrong condition check in Finish_CopyBack_Stale for eviction is also
removed.

Change-Id: Ib66acc1b9e4a6f7cea373e1fb37375427897d48d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63611
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/mem/ruby/protocol/chi/CHI-cache-actions.sm
1 file changed, 25 insertions(+), 2 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/mem/ruby/protocol/chi/CHI-cache-actions.sm b/src/mem/ruby/protocol/chi/CHI-cache-actions.sm
index 2c47ac9..d18c600 100644
--- a/src/mem/ruby/protocol/chi/CHI-cache-actions.sm
+++ b/src/mem/ruby/protocol/chi/CHI-cache-actions.sm
@@ -891,7 +891,11 @@

   tbe.actions.pushNB(Event:SendCompDBIDRespStale);
   tbe.actions.pushNB(Event:WriteFEPipe);
-  tbe.actions.push(Event:FinishCopyBack_Stale);
+
+  // eviction condition should be examined if it is the last sharer
+  if (tbe.dir_sharers.count() == 1) {
+    tbe.actions.push(Event:FinishCopyBack_Stale);
+  }

assert((tbe.dir_ownerExists == false) || (tbe.dir_owner != tbe.requestor));
 }
@@ -900,7 +904,7 @@
   // if it was the last known sharer and we don't have the data do the same
   // the Initiate_Evict
   if ((is_HN == false) && (tbe.dir_sharers.count() == 0) &&
- tbe.dir_sharers.isElement(tbe.requestor) && (tbe.dataValid == false)) {
+      (tbe.dataValid == false)) {
     tbe.actions.push(Event:SendEvict);
   }
 }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/63611?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ib66acc1b9e4a6f7cea373e1fb37375427897d48d
Gerrit-Change-Number: 63611
Gerrit-PatchSet: 2
Gerrit-Owner: Daecheol You <daecheol....@samsung.com>
Gerrit-Reviewer: Daecheol You <daecheol....@samsung.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: Tiago Muck <tiago.m...@arm.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to