feat(kernel): implemented shared memory resource with a POSIX compatible api#62
Merged
FlareCoding merged 1 commit intostellux-3.0-prototypingfrom Mar 3, 2026
Merged
Conversation
a1545ae to
78b2082
Compare
78b2082 to
3da2abd
Compare
3da2abd to
9295e8c
Compare
9295e8c to
714ccaa
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
714ccaa to
fb50b8e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
High Risk
High risk because it introduces a new shared-memory backing implementation and changes core VMA unmap/merge behavior and
mmapsemantics, which can impact memory safety, refcounting, and page lifetime across processes.Overview
Adds a new ref-counted shared-memory backing (
mm::shmem) and aSHMEMresource type, including providers for anonymousmemfd_create-style objects and named/dev/shm/<name>objects (withO_CREAT|O_EXCLandunlinkatsupport).Extends the virtual memory subsystem to support
MAP_SHAREDmappings backed byshmem(mm_context_map_shared), tracks shared VMAs with backing/offset metadata, and updates unmap/coalescing/destruction paths to unmap without freeing pages for shared mappings.Wires the feature through Linux syscalls on x86_64/aarch64: registers
memfd_create,ftruncate(now truncates either SHMEM backings or filesystem nodes via newnode::truncate/ramfs implementation),unlinkat, and updatesmmapto accept and validateMAP_SHAREDfile-backed mappings (SHMEM-only) alongside existing private anonymous mappings. Includes new unit tests covering shmem lifecycle, resize, I/O, and shared mapping behavior.Written by Cursor Bugbot for commit a1545ae. This will update automatically on new commits. Configure here.