[Openmp-commits] [PATCH] D103606: [OpenMP][Tools] Cleanup memory pool used in Archer

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jun 3 03:18:01 PDT 2021


protze.joachim created this revision.
protze.joachim added a reviewer: Hahnfeld.
protze.joachim added a project: OpenMP.
Herald added subscribers: jfb, guansong, yaxunl.
protze.joachim requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

The main motivation for reusing objects is that it helps to avoid creating and leaking synchronization clocks in TSan. The reused object will reuse the synchronization clock in TSan.

Before, new and delete operator were overloaded to get and return memory for the object from/to the object pool.
This patch replaces the operator overloading with explicit static New/Delete functions.

Objects for parallel regions and implicit tasks will always be recruited and returned to the thread-local object pool. Only for explicit task, there is a chance that an other thread completes the task and will free the object. This patch optimizes the thread-local New/Delete calls by avoiding locks and only lock if the pool is empty. Remote threads return the object into a separate queue.

This is the first patch in a series to provide better tasking support.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103606

Files:
  openmp/tools/archer/ompt-tsan.cpp
  openmp/tools/archer/tests/lit.cfg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103606.349495.patch
Type: text/x-patch
Size: 19192 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210603/d657d7fd/attachment-0001.bin>


More information about the Openmp-commits mailing list