[PATCH] D74641: [scudo][standalone] Implement batch sorting based on reclaiming

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 14 13:16:20 PST 2020


cryptoad created this revision.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.

This introduces sorting of the batches of free pointers based on how
"reclaimed" they are. After reclaiming, we count how many blocks are
within reclaimed pages (weighed as well by the number of pages they
cover), and sort the free list to put the most reclaimed batches in the
back, since we are less likely to want to work with them as they would
dirty the released memory.

This basically means that we work with a reduced subset of the possible
pointers within a region, which in return might increase the
predictability of the allocation patterns. Currently it's only enabled
for Android as the RSS/PSS constraints are higher.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74641

Files:
  compiler-rt/lib/scudo/standalone/list.h
  compiler-rt/lib/scudo/standalone/local_cache.h
  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
  compiler-rt/lib/scudo/standalone/tests/size_class_map_test.cpp
  compiler-rt/lib/scudo/standalone/wrappers_c.inc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74641.244746.patch
Type: text/x-patch
Size: 13953 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200214/841d839d/attachment.bin>


More information about the llvm-commits mailing list