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

Consider using memfd_create instead of shm_open in MemoryMappedFile if it's available #92905

Closed
stephentoub opened this issue Oct 2, 2023 · 3 comments · Fixed by #105178
Closed
Labels
area-System.IO help wanted [up-for-grabs] Good issue for external contributors in-pr There is an active PR which will close this issue when it is merged os-linux Linux OS (any supported distro) tenet-performance Performance related issue
Milestone

Comments

@stephentoub
Copy link
Member

stephentoub commented Oct 2, 2023

When this code was originally written, memfd_create didn't exist. Now that it does, we can consider using it instead of shm_open if it's available (e.g. on Linux)

@stephentoub stephentoub added this to the 9.0.0 milestone Oct 2, 2023
@ghost
Copy link

ghost commented Oct 2, 2023

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

When this code was originally written, memfd_create didn't exist. Now that it does, we can consider using it instead of shm_open.

Author: stephentoub
Assignees: -
Labels:

area-System.IO

Milestone: 9.0.0

@gfoidl
Copy link
Member

gfoidl commented Oct 3, 2023

From Chromium source:

// Check kernel version supports memfd_create(). Some older kernels segfault
// executing memfd_create() rather than returning ENOSYS (b/116769556).

But I don't know if Linux kernels older than 3.17 are still in use / supported or meet the .NET baseline (can't find that info right now :-()

PS: I saw the "if it's available", just wanted to point this out so that we don't run in strange troubles.

@adamsitnik adamsitnik added the os-linux Linux OS (any supported distro) label Oct 16, 2023
@adamsitnik
Copy link
Member

cc @tmds

@adamsitnik adamsitnik added the help wanted [up-for-grabs] Good issue for external contributors label Jul 18, 2024
@adamsitnik adamsitnik modified the milestones: 9.0.0, 10.0.0 Jul 18, 2024
@adamsitnik adamsitnik added the tenet-performance Performance related issue label Jul 18, 2024
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Jul 20, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.IO help wanted [up-for-grabs] Good issue for external contributors in-pr There is an active PR which will close this issue when it is merged os-linux Linux OS (any supported distro) tenet-performance Performance related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants