[PATCH] D83993: [scudo][standalone] Change the release loop for efficiency purposes

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 16:13:32 PDT 2020


cryptoad created this revision.
cryptoad added reviewers: pcc, cferris, hctim, eugenis.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

On 32-b, the release algo loops multiple times over the freelist for a size
class, which lead to a decrease in performance when there were a lot of free
blocks.

This changes the release functions to loop only once over the freelist, at the
cost of using a little bit more memory for the release process: instead of
working on one region at a time, we pass the whole memory area covered by all
the regions for a given size class, and work on sub-areas of `RegionSize` in
this large area. For 64-b, we just have 1 sub-area encompassing the whole
region. Of course, not all the sub-areas within that large memory area will
belong to the class id we are working on, but those will just be left untouched
(which will not add to the RSS during the release process).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83993

Files:
  compiler-rt/lib/scudo/standalone/primary32.h
  compiler-rt/lib/scudo/standalone/primary64.h
  compiler-rt/lib/scudo/standalone/release.h
  compiler-rt/lib/scudo/standalone/tests/release_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83993.278621.patch
Type: text/x-patch
Size: 16649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200716/f05b94a8/attachment.bin>


More information about the llvm-commits mailing list