This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Ensure all blocks are put in the correct group
ClosedPublic

Authored by Chia-hungDuan on Jan 17 2023, 11:52 AM.

Details

Summary

While populating new blocks, we didn't always put them into their own
groups because that needs additional sort for an almost-sorted new
blocks array. However, ensuring all blocks are placed in the right group
enables the fast identifying of unused pages in a group by simply
accouting the number of free blocks are there. Therefore, this commit is
used to set up the invariant for future optimizations.

Diff Detail

Event Timeline

Chia-hungDuan created this revision.Jan 17 2023, 11:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 17 2023, 11:52 AM
Chia-hungDuan requested review of this revision.Jan 17 2023, 11:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 17 2023, 11:52 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
cferris requested changes to this revision.Feb 16 2023, 3:24 PM

One small comment issue. After that, it's ready to submit.

compiler-rt/lib/scudo/standalone/primary32.h
645–646

This comment is slightly confusing, maybe better wording would be:

// Only shuffle if not the batches size class.

Although maybe delete the comment since it doesn't seem particularly helpful.

Same for the duplicate version of this comment in primary64.h.

This revision now requires changes to proceed.Feb 16 2023, 3:24 PM
Chia-hungDuan marked an inline comment as done.

Address review comment

This revision was not accepted when it landed; it landed in state Needs Review.Feb 22 2023, 2:13 PM
This revision was automatically updated to reflect the committed changes.