Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use extreme assertion for metadata mapped assert #812

Merged
merged 1 commit into from
May 10, 2023
Merged

Conversation

wks
Copy link
Collaborator

@wks wks commented May 10, 2023

The assert_metadata_mapped method uses the mmap system call and expects a failure. This is too costly even for debug builds. We disable it unless the "extreme_assertions" feature is enabled.

This issue has a greater impact on VMs that use the valid-object bit (VO bit) metadata because the metadata is accessed on every object allocation, and there is such an assertion in metadata access.

The rr debugging tool seems to record every system call. This PR also makes rr much faster (e.g. 14.20s vs 0.202s when running hello world in Ruby).

How to test

Compile mmtk-core with debug build, and use strace to run the VM. Before this PR, a hello world program in Ruby (using mmtk-ruby) shall have 400000+ mmap invocations returning -1 with errno = EEXIST; with this PR, they will all disappear.

The `assert_metadata_mapped` method uses the `mmap` system call and
expects a failure.  This is too costly even for debug builds.  We
disable it unless the "extreme_assertions" feature is enabled.
@wks wks marked this pull request as ready for review May 10, 2023 05:23
@wks wks requested a review from qinsoon May 10, 2023 05:23
Copy link
Member

@qinsoon qinsoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wks wks merged commit 6d93af7 into mmtk:master May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants