[Openmp-commits] [openmp] [OpenMP] Fix work-stealing stack clobber with taskwait (PR #126049)
Julian Brown via Openmp-commits
openmp-commits at lists.llvm.org
Thu Feb 6 09:53:21 PST 2025
jtb20 wrote:
> > So when the second thread comes along and allocates a "new" depnode, it's actually using a chunk of (stack) memory that is still in use by the first thread.
>
> Please explain, where allocating a new depnode will use the stack memory.
Exactly in __kmpc_omp_taskwait_deps_51, which can be invoked simultaneously by any of the threads executing tasks. The trouble is there is nothing blocking some "new" task from running that function whilst another (stolen) task is e.g. performing cleanup in __kmp_release_deps on another thread. (Again, adding that locking explicitly is probably possible, but I don't think it's a good idea. It'd kill any benefit from task stealing, since the stolen task would block.)
https://github.com/llvm/llvm-project/pull/126049
More information about the Openmp-commits
mailing list