[PATCH] D88523: scudo: Make it thread-safe to set some runtime configuration flags.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 17:10:11 PDT 2020


pcc created this revision.
pcc added reviewers: cryptoad, eugenis, hctim.
Herald added subscribers: Sanitizers, jfb, kristof.beyls.
Herald added a project: Sanitizers.
pcc requested review of this revision.

Move some of the flags previously in Options, as well as the
UseMemoryTagging flag previously in the primary allocator, into an
atomic variable so that it can be updated while other threads are
running. Relaxed accesses are used because we only have the requirement
that the other threads see the new value eventually.

The code is set up so that the variable is generally loaded once per
allocation function call with the exception of some rarely used code
such as error handlers. The flag bits can generally stay in a register
during the execution of the allocation function which means that they
can be branched on with minimal overhead (e.g. TBZ on aarch64).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88523

Files:
  compiler-rt/lib/scudo/standalone/atomic_helpers.h
  compiler-rt/lib/scudo/standalone/combined.h
  compiler-rt/lib/scudo/standalone/options.h
  compiler-rt/lib/scudo/standalone/primary32.h
  compiler-rt/lib/scudo/standalone/primary64.h
  compiler-rt/lib/scudo/standalone/wrappers_c.inc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88523.295153.patch
Type: text/x-patch
Size: 21195 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200930/bd1e164d/attachment.bin>


More information about the llvm-commits mailing list