-
Notifications
You must be signed in to change notification settings - Fork 7.9k
opcache posix creating special shared segments for FreeBSD 13 and above. #8037
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
Conversation
bd3b4d7
to
b4e7420
Compare
ext/opcache/shared_alloc_posix.c
Outdated
shared_segment->shm_fd = shm_open(shared_segment_name, O_RDWR|O_CREAT|O_TRUNC, 0600); | ||
shared_segment->shm_fd = | ||
#if defined(HAVE_SHM_CREATE_LARGEPAGE) | ||
shared_segment_lg_index > 0 ? | ||
shm_create_largepage(shared_segment_name, shared_segment_flags, shared_segment_lg_index, SHM_LARGEPAGE_ALLOC_DEFAULT, shared_segment_mode) : | ||
#endif | ||
shm_open(shared_segment_name, shared_segment_flags, shared_segment_mode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be it makes sense to fallback to shm_open
if shm_create_largepage
is failed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed
shared_segment_lg_index > 0 ? | ||
shm_create_largepage(shared_segment_name, shared_segment_flags, shared_segment_lg_index, SHM_LARGEPAGE_ALLOC_DEFAULT, shared_segment_mode) : | ||
#endif | ||
shm_open(shared_segment_name, shared_segment_flags, shared_segment_mode); | ||
if (shared_segment->shm_fd == -1) { | ||
*error_in = "shm_open"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"shm_open" name may be wrong now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we do fallback from the large page flavor to the traditional shm_open it might not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. but now you don't fallback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it looks like I missed this PR.
Please fix the merge conflict and update according to comments.
Unfortunately, I can't test this but this shouldn't break anything unrelated.
From this release, it is permitted to create shared memory blocks tagged as large for faster accesses for a size compatible with otherwise we fallback to a classic creation.
b4e7420
to
327d05a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't test this. But the sources look good now.
From this release, it is permitted to create shared memory blocks tagged
as large for faster accesses for a size compatible with otherwise
we fallback to a classic creation.