[all-commits] [llvm/llvm-project] 998334: [scudo][standalone] Change the release loop for ef...

Kostya Kortchinsky via All-commits all-commits at lists.llvm.org
Fri Jul 24 10:36:44 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 998334da2b1536e7c8f11c560770c8d4cfacb354
      https://github.com/llvm/llvm-project/commit/998334da2b1536e7c8f11c560770c8d4cfacb354
  Author: Kostya Kortchinsky <kostyak at google.com>
  Date:   2020-07-24 (Fri, 24 Jul 2020)

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

  Log Message:
  -----------
  [scudo][standalone] Change the release loop for efficiency purposes

Summary:
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).

Reviewers: pcc, cferris, hctim, eugenis

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers

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




More information about the All-commits mailing list