Skip to content

feat(kernel): implemented shared memory resource with a POSIX compatible api#62

Merged
FlareCoding merged 1 commit intostellux-3.0-prototypingfrom
pr/shmem-support
Mar 3, 2026
Merged

feat(kernel): implemented shared memory resource with a POSIX compatible api#62
FlareCoding merged 1 commit intostellux-3.0-prototypingfrom
pr/shmem-support

Conversation

@FlareCoding
Copy link
Owner

@FlareCoding FlareCoding commented Mar 3, 2026

Note

High Risk
High risk because it introduces a new shared-memory backing implementation and changes core VMA unmap/merge behavior and mmap semantics, which can impact memory safety, refcounting, and page lifetime across processes.

Overview
Adds a new ref-counted shared-memory backing (mm::shmem) and a SHMEM resource type, including providers for anonymous memfd_create-style objects and named /dev/shm/<name> objects (with O_CREAT|O_EXCL and unlinkat support).

Extends the virtual memory subsystem to support MAP_SHARED mappings backed by shmem (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 new node::truncate/ramfs implementation), unlinkat, and updates mmap to accept and validate MAP_SHARED file-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.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@FlareCoding FlareCoding merged commit a0502e4 into stellux-3.0-prototyping Mar 3, 2026
15 checks passed
@FlareCoding FlareCoding deleted the pr/shmem-support branch March 3, 2026 15:44
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.

1 participant