From: Tony Gutierrez Date: Thu, 28 Mar 2019 01:31:41 +0000 (-0400) Subject: gpu-compute: Don't track vector store insts in CU's headTailMap X-Git-Tag: v20.1.0.0~431 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f64ff892123586883872585b6d66d99399531e10;p=gem5.git gpu-compute: Don't track vector store insts in CU's headTailMap 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 Tested-by: kokoro Reviewed-by: Matt Sinclair --- diff --git a/src/gpu-compute/compute_unit.cc b/src/gpu-compute/compute_unit.cc index f3387a7b7..653c074bc 100644 --- a/src/gpu-compute/compute_unit.cc +++ b/src/gpu-compute/compute_unit.cc @@ -1389,9 +1389,11 @@ ComputeUnit::DataPort::processMemRespEvent(PacketPtr pkt) 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())); + } } }