[Openmp-commits] [PATCH] D80480: [OpenMP] Fix a race in task queue reallocation

Andrey Churbanov via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun May 24 13:20:16 PDT 2020


AndreyChurbanov added inline comments.


================
Comment at: openmp/runtime/src/kmp_tasking.cpp:385
       locked = 1;
       // expand deque to push the task which is not allowed to execute
+      if (TCR_4(thread_data->td.td_deque_ntasks) >=
----------------
Move comment under the if.


================
Comment at: openmp/runtime/src/kmp_tasking.cpp:3666
     __kmp_acquire_bootstrap_lock(&thread_data->td.td_deque_lock);
     __kmp_realloc_task_deque(thread, thread_data);
 
----------------
Could you please add same check here as well.  Though it is harder to reproduce the problem here, the pattern is the same - "get lock + realloc" without re-checking the size of deque under the lock.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80480/new/

https://reviews.llvm.org/D80480





More information about the Openmp-commits mailing list