diff options
author | Daniel R. Carvalho <odanrc@yahoo.com.br> | 2019-04-18 15:53:21 +0200 |
---|---|---|
committer | Daniel Carvalho <odanrc@yahoo.com.br> | 2019-05-08 17:41:09 +0000 |
commit | bf0a722acdd8247602e83720a5f81a0b69c76250 (patch) | |
tree | a43034cd6ae6e69d35138f0b3a36e54980531e0b /src/mem/cache/noncoherent_cache.cc | |
parent | e54c7a68f8bae79bc3fabac2534ef5af14cda9ae (diff) | |
download | gem5-bf0a722acdd8247602e83720a5f81a0b69c76250.tar.xz |
mem-cache: Remove writebacks packet list
Previously all atomic writebacks concerned a single block,
therefore, when a block was evicted, no other block would be
pending eviction. With sector tags (and compression),
however, a single replacement can generate many evictions.
This can cause problems, since a writeback that evicts a block
may evict blocks in the lower cache. If one of these conflict
with one of the blocks pending eviction in the higher level, the
snoop must inform it to the lower level. Since atomic mode does
not have a writebuffer, this kind of conflict wouldn't be noticed.
Therefore, instead of evicting multiple blocks at once, we
do it one by one.
Change-Id: I2fc2f9eb0f26248ddf91adbe987d158f5a2e592b
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18209
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/noncoherent_cache.cc')
-rw-r--r-- | src/mem/cache/noncoherent_cache.cc | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/mem/cache/noncoherent_cache.cc b/src/mem/cache/noncoherent_cache.cc index 9a2a1db9d..5ad75ee39 100644 --- a/src/mem/cache/noncoherent_cache.cc +++ b/src/mem/cache/noncoherent_cache.cc @@ -80,10 +80,9 @@ NoncoherentCache::satisfyRequest(PacketPtr pkt, CacheBlk *blk, bool, bool) } bool -NoncoherentCache::access(PacketPtr pkt, CacheBlk *&blk, Cycles &lat, - PacketList &writebacks) +NoncoherentCache::access(PacketPtr pkt, CacheBlk *&blk, Cycles &lat) { - bool success = BaseCache::access(pkt, blk, lat, writebacks); + bool success = BaseCache::access(pkt, blk, lat); if (pkt->isWriteback() || pkt->cmd == MemCmd::WriteClean) { assert(blk && blk->isValid()); @@ -98,24 +97,16 @@ NoncoherentCache::access(PacketPtr pkt, CacheBlk *&blk, Cycles &lat, } void -NoncoherentCache::doWritebacks(PacketList& writebacks, Tick forward_time) +NoncoherentCache::doWritebacks(PacketPtr pkt, Tick forward_time) { - while (!writebacks.empty()) { - PacketPtr wb_pkt = writebacks.front(); - allocateWriteBuffer(wb_pkt, forward_time); - writebacks.pop_front(); - } + allocateWriteBuffer(pkt, forward_time); } void -NoncoherentCache::doWritebacksAtomic(PacketList& writebacks) +NoncoherentCache::doWritebacksAtomic(PacketPtr pkt) { - while (!writebacks.empty()) { - PacketPtr wb_pkt = writebacks.front(); - memSidePort.sendAtomic(wb_pkt); - writebacks.pop_front(); - delete wb_pkt; - } + memSidePort.sendAtomic(pkt); + delete pkt; } void @@ -171,8 +162,7 @@ NoncoherentCache::createMissPacket(PacketPtr cpu_pkt, CacheBlk *blk, Cycles -NoncoherentCache::handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk, - PacketList &writebacks) +NoncoherentCache::handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk) { PacketPtr bus_pkt = createMissPacket(pkt, blk, true, pkt->isWholeLineWrite(blkSize)); @@ -197,7 +187,7 @@ NoncoherentCache::handleAtomicReqMiss(PacketPtr pkt, CacheBlk *&blk, // afterall it is a read response DPRINTF(Cache, "Block for addr %#llx being updated in Cache\n", bus_pkt->getAddr()); - blk = handleFill(bus_pkt, blk, writebacks, allocOnFill(bus_pkt->cmd)); + blk = handleFill(bus_pkt, blk, allocOnFill(bus_pkt->cmd)); assert(blk); } satisfyRequest(pkt, blk); |