cfallin opened PR #3760 from memfd-lazy-create
to main
:
As a followup to the recent memfd allocator work, this PR makes the
memfd image creation occur on the first instantiation, rather than
immediately when theModule
is loaded.This shaves off a potentially surprising cost spike that would have
otherwise occurred: prior to the memfd work, no allocator eagerly read
the module's initial heap state into RAM. The behavior should now more
closely resemble what happened before (and the improvements in overall
instantiation time and performance, as compared to either eager init
with pure-mmap memory or user-mode pagefault handling with uffd,
remain).<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
cfallin requested alexcrichton for a review on PR #3760.
alexcrichton submitted PR review.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Given the relative cost of locking a mutex I think it'd be better to use a
OnceCell
for this which also removes the need for cloning and a custom enum here.
cfallin updated PR #3760 from memfd-lazy-create
to main
.
cfallin updated PR #3760 from memfd-lazy-create
to main
.
cfallin submitted PR review.
cfallin created PR review comment:
Done!
alexcrichton submitted PR review.
cfallin merged PR #3760.
Last updated: Dec 23 2024 at 13:07 UTC