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

Map host FDs into AddressSpaces eagerly. #10978

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

Map host FDs into AddressSpaces eagerly.

mm.MemoryManager.MMap(), which is primarily responsible for implementing
application mmap(2), creates a sentry VMA (virtual memory area) as requested,
but does not always create PMAs (platform mapping area) or the platform
mappings they represent (via platform.AddressSpace.MapFile()). For mappings of
files (as opposed to anonymous mappings), MMap() never creates platform
mappings because the cost of doing so is unknown; in particular, if the file is
gofer-backed, then creating a platform mapping may require that the requested
pages be read from the gofer into sentry page cache, which may be relatively
slow. However, in cases where the file is directly backed by a host file
descriptor, we can override MMap()'s conservative heuristic by setting
memmap.MMapOpts.PlatformEffect to at least PlatformEffectPopulate.

@copybara-service copybara-service bot added the exported Issue was exported automatically label Sep 30, 2024
mm.MemoryManager.MMap(), which is primarily responsible for implementing
application mmap(2), creates a sentry VMA (virtual memory area) as requested,
but does not always create PMAs (platform mapping area) or the platform
mappings they represent (via platform.AddressSpace.MapFile()). For mappings of
files (as opposed to anonymous mappings), MMap() never creates platform
mappings because the cost of doing so is unknown; in particular, if the file is
gofer-backed, then creating a platform mapping may require that the requested
pages be read from the gofer into sentry page cache, which may be relatively
slow. However, in cases where the file is directly backed by a host file
descriptor, we can override MMap()'s conservative heuristic by setting
memmap.MMapOpts.PlatformEffect to at least PlatformEffectPopulate.

PiperOrigin-RevId: 679624321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exported Issue was exported automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant