mem: Add an option to perform clean writebacks from caches
Review Request #3158 - Created Oct. 19, 2015 and submitted
Information | |
---|---|
Andreas Hansson | |
gem5 | |
default | |
Reviewers | |
Default | |
Changeset 11198:d5dd32064cc2 --------------------------- mem: Add an option to perform clean writebacks from caches This patch adds the necessary commands and cache functionality to allow clean writebacks. This functionality is crucial, especially when having exclusive (victim) caches. For example, if read-only L1 instruction caches are not sending clean writebacks, there will never be any spills from the L1 to the L2. At the moment the cache model defaults to not sending clean writebacks, and this should possibly be re-evaluated. The implementation of clean writebacks relies on a new packet command WritebackClean, which acts much like a Writeback (renamed WritebackDirty), and also much like a CleanEvict. On eviction of a clean block the cache either sends a clean evict, or a clean writeback, and if any copies are still cached upstream the clean evict/writeback is dropped. Similarly, if a clean evict/writeback reaches a cache where there are outstanding MSHRs for the block, the packet is dropped. In the typical case though, the clean writeback allocates a block in the downstream cache, and marks it writable if the evicted block was writable. The patch changes the O3_ARM_v7a L1 cache configuration and the default L1 caches in config/common/Caches.py
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+151 -57) |
-
src/mem/cache/cache.cc (Diff revision 2) -
minor, but I think this would be more readable with parens around the condition, and with the RHS actually to the right of the '=', e.g.:
tempBlockWriteback = (blk->isDirty() || writebackClean) ? writebackBlk(blk) : cleanEvictBlk(blk);
or if not that, then perhaps
bool do_wb = blk->isDirty() || writebackClean; tempBlockWriteback = do_wb ? ritebackBlk(blk) : cleanEvictBlk(blk);
-
src/mem/packet.hh (Diff revision 2) -
maybe instead of IsWriteback, we should add IsEviction, and set that on all three commands
then we could:
- replace evictingBlock() with isEviction()
- define isWriteback() as isEviction() && hasData()
- create an isCleanEviction() that is isEviction() && !needsExclusive() (assuming we get rid of NeedsExclusive on WritebackClean), and use that to replace all the "== CleanEvict || == WritebackClean" expressions -
src/mem/packet.cc (Diff revision 2) -
do we really want NeedsExclusive set here?
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+151 -57) |
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+180 -84) |
If you come up with better names, that's great, but even if not this looks good to me.