This is an archive of the discontinued LLVM Phabricator instance.

[scudo] PopBatch after populateFreeList()
ClosedPublic

Authored by Chia-hungDuan on Jun 7 2023, 10:17 PM.

Details

Summary

Ensure the thread that refills freelist will get the Batch without
contending the lock in SizeClassAllocator64.

Diff Detail

Event Timeline

Chia-hungDuan created this revision.Jun 7 2023, 10:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2023, 10:17 PM
Herald added subscribers: yaneury, Enna1. · View Herald Transcript
Chia-hungDuan requested review of this revision.Jun 7 2023, 10:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2023, 10:17 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
cferris requested changes to this revision.Jun 12 2023, 7:05 PM
cferris added inline comments.
compiler-rt/lib/scudo/standalone/primary64.h
865

Wouldn't it be better to pull this out of the if and else statements like:

TransferBatch *B = popBatchImpl(C, ClassId, Region);

This revision now requires changes to proceed.Jun 12 2023, 7:05 PM
Chia-hungDuan marked an inline comment as done.

Address review comment

compiler-rt/lib/scudo/standalone/primary64.h
865

Oops, definitely it'll be better. The FLLock was held in the if-clause. I moved it out later and forgot to move the popBatchImp(). Done.

cferris accepted this revision.Jun 15 2023, 5:00 PM

LGTM.

This revision is now accepted and ready to land.Jun 15 2023, 5:00 PM
This revision was automatically updated to reflect the committed changes.