This is an archive of the discontinued LLVM Phabricator instance.

[Orc] Properly deallocate mapped memory in MapperJITLinkMemoryManager
ClosedPublic

Authored by argentite on Aug 12 2022, 5:53 AM.

Details

Summary

When memory is deallocated from MapperJITLinkMemoryManager deinitialize
actions are run through mapper and in case of InProcessMapper, memory
protections of the region are reset to read/write as they were previously
changed and can be reused in future.

Diff Detail

Event Timeline

argentite created this revision.Aug 12 2022, 5:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2022, 5:53 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
argentite published this revision for review.Aug 12 2022, 6:23 AM
argentite added reviewers: lhames, sgraenitz.

We are resetting permissions to read/write in InProcessMapper::deinitialize(). It may make sense to set them to read/write in InProcessMapper::prepare() instead. But in that case extra syscalls are made during startup instead of shutdown.

Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2022, 6:23 AM
lhames accepted this revision.Aug 12 2022, 9:21 PM

LGTM. Thanks Argentite!

This revision is now accepted and ready to land.Aug 12 2022, 9:21 PM
This revision was landed with ongoing or failed builds.Aug 12 2022, 9:43 PM
This revision was automatically updated to reflect the committed changes.