-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Avoid JIT warning with opcache.jit_buffer_size=0 #12460
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--TEST-- | ||
JIT should not emit warning with opcache.jit_buffer_size=0 | ||
--INI-- | ||
opcache.enable=1 | ||
opcache.enable_cli=1 | ||
opcache.jit=tracing | ||
opcache.jit_buffer_size=0 | ||
opcache.log_verbosity_level=2 | ||
--EXTENSIONS-- | ||
opcache | ||
--FILE-- | ||
<?php | ||
var_dump(opcache_get_status()['jit']['enabled'] ?? false); | ||
?> | ||
--EXPECT-- | ||
bool(false) |
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
To be entirely honest, I'm not a huge fan of how JIT is disabled by default using the
opcache.jit_buffer_size=0
default, instead ofopcache.jit=0
.Do you think it would be OK to change the defaults of
opcache.jit
to0
, andopcache.jit_buffer_size
to a sane default like16m
at least on master (I'd really love to make the same change on PHP-8.1 though...)?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 agree that the INI values are sub-optimal. However, changing them in 8.1 would mean anybody who enabled JIT using
jit_buffer_size
without also settingjit
would implicitly disable it. This could be changed for master, but should be discussed on the ML as it is a breaking change.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.
Is an RFC required, or just a simple email to discuss it OK?
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.
@danog Depends on whether there are any concerns. When there are concerns it's better to be safe and create a short RFC. Simple RFCs don't need to be long.
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.
@iluuu1994 Sent a discussion email + a karma request :)
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.
By the way, what about instead of completely removing the error, it simply indicated that JIT wasn't enabled because the buffer size is 0?
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 don't think the default configuration should emit a warning. It doesn't really, because
log_verbosity_level
needs to be increased. That's some INI weirdness by itself.