[all-commits] [llvm/llvm-project] 389514: [OpenMP] Fix a race in task queue reallocation

Joachim via All-commits all-commits at lists.llvm.org
Mon May 25 01:23:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3895148d7cd8ff76220f8f8209ec06369a8e816f
      https://github.com/llvm/llvm-project/commit/3895148d7cd8ff76220f8f8209ec06369a8e816f
  Author: Joachim Protze <protze at itc.rwth-aachen.de>
  Date:   2020-05-25 (Mon, 25 May 2020)

  Changed paths:
    M openmp/runtime/src/kmp_tasking.cpp

  Log Message:
  -----------
  [OpenMP] Fix a race in task queue reallocation

__kmp_realloc_task_deque implicitly assumes, that the task queue is full
(ntasks == size), therefore tail = size in line 319.
An assertion is added to document this assumption.

The first check for a full queue is before the locking and might not hold
when the lock is taken. So, we need to check again for this condition when
we have the lock.

Reviewed By: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D80480




More information about the All-commits mailing list