mem-cache: count pf filtered by demand to the same cache line

Add a stat to count how many prefetch request are filtered in the
prefetch queue becasue a demand is going to the same cache line
Also adding a corresponding debug statement for when it happens

Change-Id: I52475f19bd109c135b7259d08d5f5c0b5fd90ee5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47203
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Nathanael Premillieu
2021-05-07 10:24:33 +02:00
parent de80da9204
commit 0339f34b87
2 changed files with 9 additions and 0 deletions

View File

@@ -178,8 +178,13 @@ Queued::notify(const PacketPtr &pkt, const PrefetchInfo &pfi)
while (itr != pfq.end()) {
if (itr->pfInfo.getAddr() == blk_addr &&
itr->pfInfo.isSecure() == is_secure) {
DPRINTF(HWPrefetch, "Removing pf candidate addr: %#x "
"(cl: %#x), demand request going to the same addr\n",
itr->pfInfo.getAddr(),
blockAddress(itr->pfInfo.getAddr()));
delete itr->pkt;
itr = pfq.erase(itr);
statsQueued.pfRemovedDemand++;
} else {
++itr;
}
@@ -258,6 +263,9 @@ Queued::QueuedStats::QueuedStats(statistics::Group *parent)
"number of redundant prefetches already in prefetch queue"),
ADD_STAT(pfInCache, statistics::units::Count::get(),
"number of redundant prefetches already in cache/mshr dropped"),
ADD_STAT(pfRemovedDemand, statistics::units::Count::get(),
"number of prefetches dropped due to a demand for the same "
"address"),
ADD_STAT(pfRemovedFull, statistics::units::Count::get(),
"number of prefetches dropped due to prefetch queue size"),
ADD_STAT(pfSpanPage, statistics::units::Count::get(),

View File

@@ -182,6 +182,7 @@ class Queued : public Base
statistics::Scalar pfIdentified;
statistics::Scalar pfBufferHit;
statistics::Scalar pfInCache;
statistics::Scalar pfRemovedDemand;
statistics::Scalar pfRemovedFull;
statistics::Scalar pfSpanPage;
} statsQueued;