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

fs/shm/shmfs_alloc.c: Allocate zero-initialized memory in flat build #328

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

jlaitine
Copy link

POSIX requires that the shm objects are zero-initialized. This has been broken in some earlier commits (starting from 9af5fc5)

Also fix the flat build memory allocation to allocate both object data and payload in the same chunk (as the comment also suggests). This saves allocations and memory in a system with lots of shm objects.

@jlaitine jlaitine requested a review from pussuw December 12, 2024 10:27
@jlaitine
Copy link
Author

I will put the same suggestion to upstream as well.

@jlaitine jlaitine force-pushed the fix_shm_to_allocate_zero_initialized_memory branch 2 times, most recently from 52dd9d0 to 7631f45 Compare December 12, 2024 11:44
@jlaitine
Copy link
Author

Cleaned it up acc. to the comments...

POSIX requires that the shm objects are zero-initialized. This has been broken
in some earlier commits (starting from 9af5fc5)

Also fix the flat build memory allocation to allocate both object data and payload
in the same chunk (as the comment also suggests). This saves allocations and memory
in a system with lots of shm objects.

Signed-off-by: Jukka Laitinen <[email protected]>
@jlaitine jlaitine force-pushed the fix_shm_to_allocate_zero_initialized_memory branch from 7631f45 to 7b1babf Compare December 12, 2024 12:07
@jlaitine
Copy link
Author

And fixed also protected build branch...

@jlaitine jlaitine merged commit c0f6606 into master Dec 12, 2024
8 of 10 checks passed
@jlaitine jlaitine deleted the fix_shm_to_allocate_zero_initialized_memory branch December 12, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants