From f64ff892123586883872585b6d66d99399531e10 Mon Sep 17 00:00:00 2001 From: Tony Gutierrez Date: Wed, 27 Mar 2019 21:31:41 -0400 Subject: [PATCH] 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 --- src/gpu-compute/compute_unit.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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())); + } } } -- 2.30.2