Discussion:
[gem5-dev] Change in gem5/gem5[master]: mem-cache: allow prefetchers to emit page crossing references
(too old to reply)
Javier Bueno Hedo (Gerrit)
2018-11-29 15:37:50 UTC
Permalink
Hello Giacomo Travaglini, Andreas Sandberg,

I'd like you to do a code review. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/14735

to review the following change.


Change subject: mem-cache: allow prefetchers to emit page crossing
references
......................................................................

mem-cache: allow prefetchers to emit page crossing references

QueuedPrefetcher takes the responsability to check for page
crossing references.

Change-Id: I0ae6bf8be465118990d9ea1cac0da8f70e69aeb1
---
M src/mem/cache/prefetch/queued.cc
M src/mem/cache/prefetch/stride.cc
M src/mem/cache/prefetch/tagged.cc
3 files changed, 14 insertions(+), 22 deletions(-)



diff --git a/src/mem/cache/prefetch/queued.cc
b/src/mem/cache/prefetch/queued.cc
index f48ea18..bce6fbb 100644
--- a/src/mem/cache/prefetch/queued.cc
+++ b/src/mem/cache/prefetch/queued.cc
@@ -93,14 +93,20 @@
// Block align prefetch address
addr_prio.first = blockAddress(addr_prio.first);

- PrefetchInfo new_pfi(pfi,addr_prio.first);
+ if (samePage(pfi.getAddr(), addr_prio.first)) {
+ PrefetchInfo new_pfi(pfi,addr_prio.first);

- pfIdentified++;
- DPRINTF(HWPrefetch, "Found a pf candidate addr: %#x, "
- "inserting into prefetch queue.\n", new_pfi.getAddr());
+ pfIdentified++;
+ DPRINTF(HWPrefetch, "Found a pf candidate addr: %#x, "
+ "inserting into prefetch queue.\n", new_pfi.getAddr());

- // Create and insert the request
- insert(pkt, new_pfi, addr_prio.second);
+ // Create and insert the request
+ insert(pkt, new_pfi, addr_prio.second);
+ } else {
+ // Record the number of page crossing prefetches generate
+ pfSpanPage += 1;
+ DPRINTF(HWPrefetch, "Ignoring page crossing prefetch.\n");
+ }
}
}

diff --git a/src/mem/cache/prefetch/stride.cc
b/src/mem/cache/prefetch/stride.cc
index 5d00901..caddc75 100644
--- a/src/mem/cache/prefetch/stride.cc
+++ b/src/mem/cache/prefetch/stride.cc
@@ -195,15 +195,7 @@
}

Addr new_addr = pf_addr + d * prefetch_stride;
- if (samePage(pf_addr, new_addr)) {
- DPRINTF(HWPrefetch, "Queuing prefetch to %#x.\n",
new_addr);
- addresses.push_back(AddrPriority(new_addr, 0));
- } else {
- // Record the number of page crossing prefetches generated
- pfSpanPage += degree - d + 1;
- DPRINTF(HWPrefetch, "Ignoring page crossing prefetch.\n");
- return;
- }
+ addresses.push_back(AddrPriority(new_addr, 0));
}
} else {
// Miss in table
diff --git a/src/mem/cache/prefetch/tagged.cc
b/src/mem/cache/prefetch/tagged.cc
index a360cc6..1623817 100644
--- a/src/mem/cache/prefetch/tagged.cc
+++ b/src/mem/cache/prefetch/tagged.cc
@@ -51,13 +51,7 @@

for (int d = 1; d <= degree; d++) {
Addr newAddr = blkAddr + d*(blkSize);
- if (!samePage(blkAddr, newAddr)) {
- // Count number of unissued prefetches due to page crossing
- pfSpanPage += degree - d + 1;
- return;
- } else {
- addresses.push_back(AddrPriority(newAddr,0));
- }
+ addresses.push_back(AddrPriority(newAddr,0));
}
}
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/14735
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I0ae6bf8be465118990d9ea1cac0da8f70e69aeb1
Gerrit-Change-Number: 14735
Gerrit-PatchSet: 1
Gerrit-Owner: Javier Bueno Hedo <***@metempsy.com>
Gerrit-Reviewer: Andreas Sandberg <***@arm.com>
Gerrit-Reviewer: Giacomo Travaglini <***@arm.com>
Gerrit-MessageType: newchange
Continue reading on narkive:
Loading...