This is an archive of the discontinued LLVM Phabricator instance.

[scudo][fuchsia] Precommit pages when going beyond static buffer size
AbandonedPublic

Authored by yaneury on Dec 12 2022, 5:17 PM.

Details

Reviewers
None
Summary

This revision is superseded by https://reviews.llvm.org/D140320

Diff Detail

Event Timeline

yaneury created this revision.Dec 12 2022, 5:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2022, 5:17 PM
yaneury requested review of this revision.Dec 12 2022, 5:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2022, 5:17 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
phosek added a subscriber: phosek.Dec 13 2022, 6:39 AM

When uploading patches to Phabricator via web interface, it's recommended that you include as much context as possible (by using e.g. git show HEAD -U999999 > mypatch.patch), see https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface for more details.

cryptoad added inline comments.Dec 13 2022, 7:49 AM
compiler-rt/lib/scudo/standalone/common.h
150

Uppercase U for consistency

compiler-rt/lib/scudo/standalone/fuchsia.cpp
117

Looks long, was that formatted with clang-format?

compiler-rt/lib/scudo/standalone/release.h
85

Probably | rather than &?

Chia-hungDuan added inline comments.Dec 13 2022, 9:25 AM
compiler-rt/lib/scudo/standalone/release.h
85

We support partial page release which only releases paritial memory groups but we haven't supported allocating page map only for subrange of region (I'm working on that). Which means, we may prefault more pages than necessary.

As discussed with Luke (Luke Nicholson), Fuchsia will still benefit from the prefault even with those unnecessary pages. I'm wondering if we can do this for Fuchsia only now. I think we will end up prefault the page map here so I'm inclined to do that for all platforms after we can allocate page map for subrange of region

I know it only does real prefault work on Fuchsia now but the code structure may give the impression that we will always prefault the pages.

What do you think?

yaneury updated this revision to Diff 482521.Dec 13 2022, 9:26 AM

Fixed suggested errors

yaneury added inline comments.Dec 13 2022, 9:30 AM
compiler-rt/lib/scudo/standalone/release.h
85

Are you suggesting we pass the flag "MAP_PRECOMMIT" only when running on Fuchsia? If so, what's the pattern for doing that?

#ifdef SCUDO_FUCHSIA

...

#endif
Chia-hungDuan added inline comments.Dec 13 2022, 9:36 AM
compiler-rt/lib/scudo/standalone/release.h
85

Yes, I may suggest using SCUDO_FUCHSIA now.

BTW, can you also share some performance number before/after this change?

yaneury abandoned this revision.Dec 19 2022, 10:28 AM
yaneury edited the summary of this revision. (Show Details)

This revision is superseded by https://reviews.llvm.org/D140320