Skip to content

Remove unused methods and types related to memory mapping#1383

Merged
wks merged 3 commits intommtk:masterfrom
wks:fix/no-mmapper-protect
Sep 2, 2025
Merged

Remove unused methods and types related to memory mapping#1383
wks merged 3 commits intommtk:masterfrom
wks:fix/no-mmapper-protect

Conversation

@wks
Copy link
Collaborator

@wks wks commented Sep 1, 2025

We remove the protect method and the Mmapper::Protected state. This is because Mmapper cannot protect the memory at the granularity desired by its users. Spaces that wish to protect pages of memory should directly call mprotect while the space still owns the memory.

We also remove the unused eagerly_mmap_all_spaces method. It has never been implemented or used since it was added to JikesRVM MMTk.

We also remove Space::ensure_mapped. It was used for the boot image back in JikesRVM. We now use the VMSpace for boot images, and it can call MMAPPER.mark_as_mapped to mark the memory as mapped in the Mmapper without actually calling mmap, assuming the VM has already mapped the memory. So we remove the redundant Space::ensure_mapped method.

Fixes: #1348

wks added 3 commits September 1, 2025 21:42
We remove the `protect` method and the `Mmapper::Protected` state.  This
is because Mmapper cannot protect the memory at the granularity desired
by its users.  Spaces that wish to protect pages of memory should
directly call `mprotect` while the space still owns the memory.

We also remove the unused `eagerly_mmap_all_spaces` method.

Fixes: mmtk#1348
@wks wks marked this pull request as ready for review September 2, 2025 01:09
@wks wks requested a review from qinsoon September 2, 2025 01:09
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 enabled auto-merge September 2, 2025 01:24
@wks wks disabled auto-merge September 2, 2025 02:13
@wks wks enabled auto-merge September 2, 2025 02:18
@wks wks added this pull request to the merge queue Sep 2, 2025
Merged via the queue into mmtk:master with commit 8d8aae2 Sep 2, 2025
32 of 33 checks passed
@wks wks deleted the fix/no-mmapper-protect branch September 2, 2025 03:43
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.

The currently unused Mmapper::protect

2 participants