This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Try to release pages after unlocking the TSDs
ClosedPublic

Authored by Chia-hungDuan on Jun 14 2023, 6:27 PM.

Details

Summary

This increases the parallelism and the usage of TSDs

Diff Detail

Event Timeline

Chia-hungDuan created this revision.Jun 14 2023, 6:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2023, 6:27 PM
Herald added subscribers: yaneury, Enna1. · View Herald Transcript
Chia-hungDuan requested review of this revision.Jun 14 2023, 6:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2023, 6:27 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
cferris requested changes to this revision.Jun 14 2023, 6:42 PM
cferris added inline comments.
compiler-rt/lib/scudo/standalone/primary32.h
236–237

It's not clear why that this is equivalent to the new os release in combined.h. Is this call completely replaced by that call in all circumstances?

This revision now requires changes to proceed.Jun 14 2023, 6:42 PM

Add more comment

compiler-rt/lib/scudo/standalone/primary32.h
236–237

The call stacks before:

  • deallocate() /* combined.h */
    • deallocate() /* local_cache.h */
      • drain() /* local_cache.h */ /* call pushBlocks() if NeedToDrainCache */
        • pushBlocks() /* primary32/64.h */
          • releaseToOSMaybe() /* primary32/64.h */

The call stack after:

  • deallocate() /* combined.h */
    • deallocate() /* local_cache.h */
      • drain() /* local_cache.h */ /* call pushBlocks() if NeedToDrainCache */
        • pushBlocks() /* primary32/64.h */
    • releaseToOSMaybe() /* primary32/64.h */ /* call this if NeedToDrainCache */

pushBlocks is the only place we will do proactive page release and we still have that call except that it's detached from pushBlocks

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

That makes sense to me.

LGTM.

This revision is now accepted and ready to land.Jun 15 2023, 5:56 PM