Skip to content

Allow JITServer to ignore line number requests - #19999

Merged
mpirvu merged 1 commit into
eclipse-openj9:masterfrom
cjjdespres:let-server-ignore-lines
Aug 19, 2024
Merged

Allow JITServer to ignore line number requests#19999
mpirvu merged 1 commit into
eclipse-openj9:masterfrom
cjjdespres:let-server-ignore-lines

Conversation

@cjjdespres

Copy link
Copy Markdown
Contributor

The method getLineNumberForMethodAndByteCodeIndex, in the base VM frontend, is supposed to retrieve the line number corresponding to a method and byte codex index from the method's associated ROM method. At the server, these line numbers are not directly accessible, so the server must request this information from the client whenever that method is called.

These line numbers appear to be used only when generating compilation logs. The most notable use of this method for that purpose is in dumping IL trees - for every line of this dump, this method will be called. Even this network overhead is not usually significant. However, if the method being compiled at the server is very large, at a high optimization level, and has many trace options enabled, these line number messages can slow the compilation significantly. This can make some test failures more difficult to reproduce, if they are timing-sensitive.

The environment variable TR_JITServerShouldIgnoreLineNumbers will, if set in the server environment, cause the server to skip consulting the client for line numbers, and instead return -1 from this method always. This results in a moderate decrease in remote compilation time in the scenario outlined above, and can improve test failure reproducibility. Compilations of large methods will still be much slower at high optimization and trace levels, however, so this won't necessarily solve the issue fully.

@cjjdespres
cjjdespres requested a review from dsouzai as a code owner August 14, 2024 14:44
@cjjdespres

Copy link
Copy Markdown
Contributor Author

Attn @mpirvu. This environment variable did seem to improve the failure rate of #14755, though the failures (at the client and server) are strange enough that full logs weren't of as much help as I would have liked.

I originally implemented (and tested) this as a new -Xjit option in omr so it could be enabled selectively for individual methods. I could go back to that implementation if you'd prefer that, but I thought that this scenario was niche enough that disabling line numbers unconditionally with an environment variable would be fine.

@cjjdespres

Copy link
Copy Markdown
Contributor Author

The line endings check error looks like a network failure.

@mpirvu mpirvu self-assigned this Aug 14, 2024
@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Aug 14, 2024

@mpirvu mpirvu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. The only caveat I see is that we have to remember to use the env var at the server and not at the client.
I think there is some doc about how to debug JITServer issues. Could you please update that doc with this env var?

The method getLineNumberForMethodAndByteCodeIndex, in the base
VM frontend, is supposed to retrieve the line number corresponding to a
method and byte codex index from the method's associated ROM method. At
the server, these line numbers are not directly accessible, so the
server must request this information from the client whenever that
method is called.

These line numbers appear to be used only when generating compilation
logs. The most notable use of this method for that purpose is in dumping
IL trees - for every line of this dump, this method will be called. Even
this network overhead is not usually significant. However, if the method
being compiled at the server is very large, at a high optimization
level, and has many trace options enabled, these line number messages
can slow the compilation significantly. This can make some test failures
more difficult to reproduce, if they are timing-sensitive.

The environment variable TR_JITServerShouldIgnoreLineNumbers will, if
set in the server environment, cause the server to skip consulting the
client for line numbers, and instead return -1 from this method always.
This results in a moderate decrease in remote compilation time in the
scenario outlined above, and can improve test failure reproducibility.
Compilations of large methods will still be much slower at high
optimization and trace levels, however, so this won't necessarily solve
the issue fully.

Signed-off-by: Christian Despres <despresc@ibm.com>
@cjjdespres
cjjdespres force-pushed the let-server-ignore-lines branch from 45b1432 to 870fe54 Compare August 15, 2024 15:47
@mpirvu

mpirvu commented Aug 15, 2024

Copy link
Copy Markdown
Contributor

jenkins test sanity zlinuxjit,xlinuxjit jdk21

@mpirvu
mpirvu merged commit c3cdfab into eclipse-openj9:master Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:jitserver Artifacts related to JIT-as-a-Service project

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants