Stop side exit tracing when reach max_root_trace#9964
Open
wxue1 wants to merge 1 commit intophp:masterfrom
Open
Stop side exit tracing when reach max_root_trace#9964wxue1 wants to merge 1 commit intophp:masterfrom
wxue1 wants to merge 1 commit intophp:masterfrom
Conversation
When max_root_trace is reached, tracing JIT will not compile any new code for side trace, but side exit tracing is still going on. Stop it immediately instead of lazy blacklisting. This reduces JIT cost and potentially improve PHP execution efficiency. Signed-off-by: Wang, Xue <xue1.wang@intel.com> Reviewed-by: Chen, Hu <hu1.chen@intel.com> Reviewed-by: Su, Tao <tao.su@intel.com>
dstogov
reviewed
Nov 21, 2022
Member
dstogov
left a comment
There was a problem hiding this comment.
I'm not sure if this is the right decision.
Blacklisting includes code generation for deoptimization. This is not a cheap process and doing this for all side exits at once may take significant time. Many side exits are never used and code generation for them is useless and will lead to additional code bloat.
I'm open for your arguments.
| /* Traverse all JITed code, restore side exit to vm execution */ | ||
| for (i = 1; i < ZEND_JIT_TRACE_NUM; i++) { | ||
| for (j = 0; j < zend_jit_traces[i].exit_count; j++) { | ||
| zend_jit_blacklist_trace_exit(i, j); |
Member
There was a problem hiding this comment.
It makes sense to avoid calling zend_jit_blacklist_trace_exit() for already jit-ed and blacklisted side exits. This would remove unnecessary locks.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When max_root_trace is reached, tracing JIT will not compile any new code for side trace, but side exit tracing is still going on. Stop it immediately instead of lazy blacklisting. This reduces JIT cost and potentially improve PHP execution efficiency.
Signed-off-by: Wang, Xue xue1.wang@intel.com
Reviewed-by: Chen, Hu hu1.chen@intel.com
Reviewed-by: Su, Tao tao.su@intel.com