[PATCH] D75142: [scudo][standalone] Various improvements wrt RSS

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 14:27:03 PST 2020


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

This patch includes several changes to reduce the overall footprint
of the allocator:

- for realloc'd chunks: only keep the same chunk when lowering the size if the delta is within a page worth of bytes;
- when draining a cache: drain the beginning, not the end; we add pointers at the end, so that meant we were draining the most recently added pointers;
- change the release code to account for an freed up last page: when scanning the pages, we were looking for pages fully covered by blocks; in the event of the last page, if it's only partially covered, we wouldn't mark it as releasable - even what follows the last chunk is all 0s. So now mark the rest of the page as releasable, and adapt the test;
- add a missing `setReleaseToOsIntervalMs` to the cacheless secondary;
- adjust the Android classes based on more captures thanks to pcc@'s tool.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75142

Files:
  compiler-rt/lib/scudo/standalone/combined.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/secondary.h
  compiler-rt/lib/scudo/standalone/size_class_map.h
  compiler-rt/lib/scudo/standalone/tests/release_test.cpp
  compiler-rt/lib/scudo/standalone/tests/size_class_map_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75142.246571.patch
Type: text/x-patch
Size: 14602 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200225/420353c8/attachment-0001.bin>


More information about the llvm-commits mailing list