[all-commits] [llvm/llvm-project] 19c26a: [scudo] Finer lock granularity in Region of SizeCl...

ChiaHungDuan via All-commits all-commits at lists.llvm.org
Tue Jun 20 11:37:19 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 19c26a7c03559a6c7ab1968fcf98e39fd4a86714
      https://github.com/llvm/llvm-project/commit/19c26a7c03559a6c7ab1968fcf98e39fd4a86714
  Author: Chia-hung Duan <chiahungduan at google.com>
  Date:   2023-06-20 (Tue, 20 Jun 2023)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/primary64.h

  Log Message:
  -----------
  [scudo] Finer lock granularity in Region of SizeClassAllocator64

In this CL, we introduce two new locks, MMLock for MemMap operations and
FLLock for freelist operations.

MMLock will be used when we want to manipulate pages. For example,
mapping more pages through populateFreeList() and releaseToOSMaybe().

FLLock will be used when we want to access the freelist. For example,
pushBlocks() and popBatch().

With the new locks, they increase the parallelism of the operations
mentioned above. For example, populateFreeList() won't block the
pushBlocks() when it's still doing the system call for more pages.

We also enforce lock hierarchy to avoid deadlock, MMLock is required to
be held before FLLock if you have to lock both of them. We don't store
the lock owner, therefore, we rely static thread-safey annotation to
detect any violation.

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




More information about the All-commits mailing list