Skip to content

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

Conversation

iluuu1994
Copy link
Member

/cc @danog

@iluuu1994 iluuu1994 requested a review from dstogov October 17, 2023 16:15
zend_accel_error(ACCEL_LOG_WARNING, "Could not enable JIT!");
/* The JIT is implicitly disabled with opcache.jit_buffer_size=0, so we don't want to
* emit a warning here. */
if (JIT_G(buffer_size) != 0) {
Copy link
Contributor

@danog danog Oct 17, 2023

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 of opcache.jit=0.

Do you think it would be OK to change the defaults of opcache.jit to 0, and opcache.jit_buffer_size to a sane default like 16m at least on master (I'd really love to make the same change on PHP-8.1 though...)?

Copy link
Member Author

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 setting jit would implicitly disable it. This could be changed for master, but should be discussed on the ML as it is a breaking change.

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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 :)

Copy link
Contributor

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?

Copy link
Member Author

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.

@iluuu1994 iluuu1994 force-pushed the fix-jit-warning-with-zero-buffer branch from e996a58 to 95dfeba Compare October 17, 2023 22:59
Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

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

I think this is a right solution for the old versions.

@danog Changing defaults in master may make sense, but note that now JIT may be enabled but switched off on start-up and then switched on only for specific requests.

@iluuu1994 iluuu1994 closed this in 07d8159 Oct 18, 2023
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.

3 participants