mem: Delay deleting of incoming packets by one call.
This patch is a temporary fix until Andreas' four-phase patches get reviewed and committed. Removing FastAlloc seems to have exposed an issue which previously was reasonable rare in which packets are freed before the sending cache is done with them. This change puts incoming packets no a pendingDelete queue which are deleted at the start of the next call and thus breaks the dependency between when the caller returns true and when the packet is actually used by the sending cache. Running valgrind on a multi-core linux boot and the memtester results in no valgrind warnings.
This commit is contained in:
7
src/mem/cache/cache.hh
vendored
7
src/mem/cache/cache.hh
vendored
@@ -190,6 +190,13 @@ class Cache : public BaseCache
|
||||
*/
|
||||
const bool prefetchOnAccess;
|
||||
|
||||
/**
|
||||
* @todo this is a temporary workaround until the 4-phase code is committed.
|
||||
* upstream caches need this packet until true is returned, so hold it for
|
||||
* deletion until a subsequent call
|
||||
*/
|
||||
std::vector<PacketPtr> pendingDelete;
|
||||
|
||||
/**
|
||||
* Does all the processing necessary to perform the provided request.
|
||||
* @param pkt The memory request to perform.
|
||||
|
||||
Reference in New Issue
Block a user