-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8315818: vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.java fails on libgraal #15602
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
Conversation
👋 Welcome back dnsimon! A progress list of the required criteria for merging this PR into |
Webrevs
|
This seems a bit unsavory to me. Why can't we set CompileBroker::_initialized to true in the same place that C2 does, but move the |
…tions until JVMCI is initializable
@@ -301,7 +301,7 @@ class CompileBroker: AllStatic { | |||
int hot_count, | |||
CompileTask::CompileReason compile_reason, | |||
TRAPS); | |||
|
|||
private: |
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.
Making this helper method avoids anyone outside CompileBroker
accidentally calling it.
Thanks for the suggestion Tom. I've pushed a change that implements it. |
@@ -754,9 +744,8 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { | |||
#endif | |||
|
|||
#if INCLUDE_JVMCI | |||
if (force_JVMCI_intialization) { | |||
if (force_JVMCI_initialization) { | |||
JVMCI::initialize_compiler(CHECK_JNI_ERR); |
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.
Does anything bad happen if force_JVMCI_initialization is true and we end up initializing the compiler from the compile broker thread instead? I guess that would be adding Xcomp to the the other flags that force initialization.
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.
Both JVMCIPrintProperties
and JVMCILibDumpJNIConfig
explicitly do the equivalent of System.exit()
once they've performed their task so I don't think it matters which thread triggers the task. I don't think it will cause any problems for EagerJVMCI
either. In fact, I don't think we really need EagerJVMCI
any more as it's only purpose was to make JVMCIPrintProperties
guaranteed to do something.
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.
Ok.
@@ -56,6 +56,11 @@ const char* JVMCI::_fatal_log_filename = nullptr; | |||
void jvmci_vmStructs_init() NOT_DEBUG_RETURN; | |||
|
|||
bool JVMCI::can_initialize_JVMCI() { |
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.
For the non libgraal case is this test really complete? I guess I'm not convinced that the tests in this method are sufficient the safe init point. Maybe it would be simpler to have a JVMCI::_can_be_initialized
flag which is set at the correct point during the init steps in the same way that CompileBroker::_initialized
is set. Having the order explicitly spelled out there seems better than trying to infer it from other state.
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.
We've been running this code for a long time (Graal unit tests on jargraal, Native Image building of libgraal etc) so I don't see any reason to double-guess its correctness now. I suggest we leave it as is and address problems when/if they show up.
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.
Ok.
Yes I like that much better. |
@dougxc This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 19 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Thanks for the review Tom. /integrate |
1 similar comment
Thanks for the review Tom. /integrate |
Going to push as commit ebc718f.
Your commit was automatically rebased without conflicts. |
@dougxc The command |
@dougxc - please remember that all hotspot changes require at least 2 reviews. |
Instead of eagerly initializing JVMCI for
-Xcomp
, this defers JVMCI compilations until JVMCI is initializable. In the case of libgraal, no compilations are deferred since libgraal is always initializable. For jargraal, it still has to wait until the VM has reached a certain initialization phase so as to avoid deadlocks bewteen the main thread and a compiler thread.This allows tests such as
vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.java
to succeed on libgraal, even when there is insufficient virtual memory to mmap libgraal. Failing to initialize libgraal in that scenario now results in a bailout instead of exiting the VM.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15602/head:pull/15602
$ git checkout pull/15602
Update a local copy of the PR:
$ git checkout pull/15602
$ git pull https://git.openjdk.org/jdk.git pull/15602/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15602
View PR using the GUI difftool:
$ git pr show -t 15602
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15602.diff
Webrev
Link to Webrev Comment