gem5-dev@gem5.org

The gem5 Developer List

View all threads

[S] Change in gem5/gem5[develop]: mem-ruby: bug fix for stale WriteBack

DY
Daecheol You (Gerrit)
Mon, Sep 19, 2022 1:57 AM

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.jg@gmail.com
Maintainer: Jason Lowe-Power power.jg@gmail.com
Tested-by: kokoro noreply+kokoro@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.you@samsung.com
Gerrit-Reviewer: Daecheol You daecheol.you@samsung.com
Gerrit-Reviewer: Jason Lowe-Power jason@lowepower.com
Gerrit-Reviewer: Jason Lowe-Power power.jg@gmail.com
Gerrit-Reviewer: Tiago Muck tiago.muck@arm.com
Gerrit-Reviewer: kokoro noreply+kokoro@google.com
Gerrit-MessageType: merged

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.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@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.you@samsung.com> Gerrit-Reviewer: Daecheol You <daecheol.you@samsung.com> Gerrit-Reviewer: Jason Lowe-Power <jason@lowepower.com> Gerrit-Reviewer: Jason Lowe-Power <power.jg@gmail.com> Gerrit-Reviewer: Tiago Muck <tiago.muck@arm.com> Gerrit-Reviewer: kokoro <noreply+kokoro@google.com> Gerrit-MessageType: merged