-
Notifications
You must be signed in to change notification settings - Fork 728
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
Add support for -XX:+EnableDynamicAgentLoading #17085
Comments
JEP 261: Module System proposed This change prevents the AttachAPI from loading an agent into a JVM after startup openj9/runtime/vm/BytecodeInterpreter.hpp Lines 4773 to 4775 in 11eb3b7
which invokes openj9/runtime/jvmti/jvmtiStartup.c Lines 556 to 563 in 11eb3b7
|
Prototype for command line option is at #17215. @JasonFengJ9 are you saying we should also error out when attempting to load an agent? If so is it sufficient to check the |
I think a new runtime flag is required. |
As OpenJ9's agentload code only have a single entry point in JCL, could just add new check for the flag/property at openj9/jcl/src/java.base/share/classes/openj9/internal/tools/attach/target/Attachment.java Lines 369 to 383 in 84d3914
This would be a requirement if we want enable optimization to allow VirtualThread to skip |
From a functional perspective, all we need to do is disable dynamic loading of agents. However, given that in J9 an agent can always be dynamically loaded we need to support OSR/HCR all the time. The removal of this capability lets us disable HCR/OSR as default JVM capabilities and only apply them when they are needed which is important from a performance perspective. This issue was created as an attempt to do some early refactoring and combine default enablement of HCR/OSR under EnableDynamicAgentLoading |
I've updated the description to be more clear |
Please explain how this is not in fundamental conflict with the intent of |
The fact that J9 always allows dynamic agent loading is not spec behaviour. In fact, it hasn't always been J9 behaviour. In the early releases of JDK8 this was not the case. The new proposed options standardizes this behaviour. |
Just to be crystal clear, so using |
yes, thats correct |
Flag controls runtime loading of dynamic agents - When EnableDynamicAgentLoading is enabled, OSR/HCR flags are enabled and dynamic agent loading is also enabled. - When EnableDynamicAgentLoading is disabled, OSR/HCR flags default to off, and are enabled if/when agents are attached at startup. Dynamic loading of agents is disabled. Issue eclipse-openj9#17085 Signed-off-by: Devin Nakamura <[email protected]>
Closing as initial PR is merged |
Currently, j9 supports dynamic loading agents by default.
The capabilities required for agents are:
These are currently enabled all the time.
We need to put default enablement of these capabilities under the
EnableDynamicAgentLoading
flag. This will make it possible to turn offEnableDynamicAgentLoading
in a future release if it is required in a future release. For nowEnableDynamicAgentLoading
can remain enabled by default. This will change likely in JDK21.Additionally, we need to detect jvm agents attached are startup. We can look at
createAgentLibrary(
and lazily add the OSR/HCR flags when this occurs.We should add a runtime flag, for dynamic agent loading, this can be used to check if an agent is allowed to be loading at runtime.
The end result is:
EnableDynamicAgentLoading
is enabled, OSR/HCR flags are enable and dynamic agent loading is also enabled.EnableDynamicAgentLoading
is disabled, OSR/HCR is only enabled when agents are attached at startup. Dynamic loading of agents is disabled.The text was updated successfully, but these errors were encountered: