[all-commits] [llvm/llvm-project] a0e864: [scudo][standalone] Do not fill 32b regions at once

Kostya Kortchinsky via All-commits all-commits at lists.llvm.org
Wed Mar 4 14:23:26 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a0e86420ae72e4dc38c3a341943d4f14139e1e4b
      https://github.com/llvm/llvm-project/commit/a0e86420ae72e4dc38c3a341943d4f14139e1e4b
  Author: Kostya Kortchinsky <kostyak at google.com>
  Date:   2020-03-04 (Wed, 04 Mar 2020)

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

  Log Message:
  -----------
  [scudo][standalone] Do not fill 32b regions at once

Summary:
For the 32b primary, whenever we created a region, we would fill it
all at once (eg: create all the transfer batches for all the blocks
in that region). This wasn't ideal as all the potential blocks in
a newly created region might not be consummed right away, and it was
using extra memory (and release cycles) to keep all those free
blocks.

So now we keep track of the current region for a given class, and
how filled it is, carving out at most `MaxNumBatches` worth of
blocks at a time.

Additionally, lower `MaxNumBatches` on Android from 8 to 4. This
lowers the randomness of blocks, which isn't ideal for security, but
keeps things more clumped up for PSS/RSS accounting purposes.

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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




More information about the All-commits mailing list