Page MenuHomePhabricator

[scudo][standalone] Implement batch sorting based on reclaiming

Authored by cryptoad on Feb 14 2020, 1:07 PM.



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.

Diff Detail

Event Timeline

cryptoad created this revision.Feb 14 2020, 1:07 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 14 2020, 1:07 PM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
cryptoad updated this revision to Diff 244752.Feb 14 2020, 1:29 PM

Fixing a conversion error, updating a test.

cryptoad updated this revision to Diff 245232.Feb 18 2020, 12:01 PM

Only sort if a release occured.

cryptoad updated this revision to Diff 245450.Feb 19 2020, 9:48 AM

Only sort batches when a release occured on 32-bit.

cryptoad abandoned this revision.Mar 3 2020, 11:09 AM