[Openmp-commits] [PATCH] D154523: [OpenMP][AMDGPU] Tracking of busy HSA queues
Michael Halkenhäuser via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Jul 13 08:27:31 PDT 2023
mhalk added inline comments.
================
Comment at: openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:1478-1481
+ std::unique_lock<std::mutex> Lock(Mutex);
+ (*Resource).Queue->removeUser();
+ Lock.unlock();
+ GenericDeviceResourceManagerTy::returnResource(Resource);
----------------
Rather unhappy with this particular piece of code.
Now there's a chance for interleaving.
I don't know if that's good, "ok" or bad, but if I had to guess: the latter.
But without unlocking, this will cause a deadlock.
(Could also revert to a `lock_guard` and call it's dtor, if preferred.)
Thoughts and comments on this would be highly appreciated.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154523/new/
https://reviews.llvm.org/D154523
More information about the Openmp-commits
mailing list