This change fixes a memory leak due to live GPUDynInstPtr references
to vector store insts being stored in the CU's headTailMap and never
released.
This happened because store insts are not supposed to have their
head-tail latencies tracked by the headTailMap; instead they use
timing information from the GPUCoalescer. When updating the
headTailLatency stat via the headTailMap, only loads were considered
and removed from the headTailMap, however when inserting into the
headTailMap loads and stores were considered, thus leading to the
memory leak.
This change fixes the issue by only adding loads to the headTailMap.
Change-Id: I8a8f5b79f55e00481ae5e82519a9ed627a7ecbd1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29963
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
gpuDynInst->wfSlotId);
}
} else {
- if (!compute_unit->headTailMap.count(gpuDynInst)) {
- compute_unit->headTailMap.insert(
- std::make_pair(gpuDynInst, curTick()));
+ if (pkt->isRead()) {
+ if (!compute_unit->headTailMap.count(gpuDynInst)) {
+ compute_unit->headTailMap
+ .insert(std::make_pair(gpuDynInst, curTick()));
+ }
}
}