-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8284161: Implementation of Virtual Threads (Preview) #8166
Conversation
/contributor add rpressler |
👋 Welcome back alanb! A progress list of the required criteria for merging this PR into |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman |
@AlanBateman The |
@AlanBateman The |
@AlanBateman The |
@AlanBateman The |
@AlanBateman The |
@AlanBateman The |
@AlanBateman The |
@AlanBateman The |
@AlanBateman an approved CSR request is already required for this pull request. |
@AlanBateman The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
So, does this PR pass current GHA checks? I see they are not enabled for this PR. It would be unfortunate for this large integration to break builds/tests for smaller PRs that would follow it. |
I've completed review of new vthread-related tests in the folder serviceability/jvmti. |
I've enabled it on my fork and we'll see if it kicks in. |
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.
Studied the java.io package edits, the new JFR events and the new jcmd dump_to_file functionality. Looks good!
@AlanBateman 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
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.
I am sorry to be a buzzkill here, but this integration would break lots of platforms even when Loom functionality is not enabled/used. For example, running java -version
on RISC-V runs into many issues: TemplateInterpreterGenerator::generate_Continuation_doYield_entry
runs into Unimplemented()
, UnsafeCopyMemory
asserts about UCM table size, NativeDeoptInstruction::is_deopt
would run into Unimplemented()
while being called from signal handler.
This effectively blocks development on those platforms, and it seems to be too much breakage for a preview feature. Are we really breaking these platforms? Do we have plans in place with maintainers of those platforms to fix all this in JDK 19 timeframe? I'd suggest holding off the integration until such a plan and agreement is in place.
We mailed porters-dev in Sep 2021 to give a heads up that this feature would require porting work so it shouldn't be a surprise. We have been open to including other ports with the initial integration but it was never a goal to have all the ports done in advance of that. Most of the new code in the VM is only used when running with --enable-preview. You'll see several places that test Continuations::enabled(). It should be possible to get these port running without -enable-preview without much effort. The feature has to be implemented to pass all the tests of course. |
It is understandable to ship the preview feature not implemented on all platforms. It is even understandable to ship the final product feature that breaks some platforms in an clearly understandable way, prompting platform maintainers to implement the agreed-upon, final Java feature. What I am seeing, though, is that just running
It is not as clear-cut, unfortunately. I see there are substantial changes in deopt machinery with post-call NOPs -- and there maybe more stuff lurking after that one is implemented -- so it is not as simple as changing I would have honestly expected those core changes to be heavily conditionalized with either My fear is that an integration like this would wreck JDK 19 release. So my question stands: Are we breaking those platforms? Are we sure the unconditional VM changes are problem-free, implementable everywhere, etc? The answer might be "Yes, we are integrating, let the chips fall where they may", but I also believe that should be the call made by responsible platform/VM architects, who should explicitly weigh in and accept the risk of wide JDK 19 breakage. |
Preview features need to be implemented by a port before it can be released. For JDK 19 this means that the maintainers of ports will have work to do for both JEP 424 and JEP 425 (ifdef is not an option). I think the issue that you are concerned about is the interim period between the JEP 425 integration and the port/implementation of this feature to other architectures. I think the answer is that it will vary. It may be that some port maintainers decide to do something very short term so they can run without --enable-preview and buy time before they do the port/implementation for JDK 19. Good progress has been reported on at least ppc64le port and maybe that port be ready before others. So yes, some ports may crash until they receive attention, others (like zero) should be able to run tests that don't use --enable-preview. I've no doubt there will be a flurry of changes post integration. The motivation for Continuations::enabled() was to reduce risk and disable a lot of the new code by default. The motivation wasn't porting but it may be helpful during the interim period. That is probably a topic for loom-dev rather than here. |
/integrate |
Going to push as commit 9583e36. |
@AlanBateman Pushed as commit 9583e36. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This is the implementation of JEP 425: Virtual Threads (Preview).
We will refresh this PR periodically to pick up changes and fixes from the loom repo.
Most of the new mechanisms in the HotSpot VM are disabled by default and require running with
--enable-preview
to enable.The patch has support for x64 and aarch64 on the usual operating systems (Linux, macOS, and Windows). There are stubs (calling Unimplemented) for zero and some of the other ports. Additional ports can be contributed via PRs against the fibers branch in the loom repo.
There are changes in many areas. To reduce notifications/mails, the labels have been trimmed down for now to hotspot, serviceability and core-libs. We can add additional labels, if required, as the PR progresses.
The changes include a refresh of java.util.concurrent and ForkJoinPool from Doug Lea's CVS. These changes will probably be proposed and integrated in advance of this PR.
The changes include some non-exposed and low-level infrastructure to support the (in draft) JEPs for Structured Concurrency and Extent Locals. This is to make life a bit easier and avoid having to separate VM changes and juggle branches at this time.
Progress
Issues
Reviewers
Contributors
<rpressler@openjdk.org>
<alanb@openjdk.org>
<eosterlund@openjdk.org>
<aph@openjdk.org>
<rbackman@openjdk.org>
<mgronlun@openjdk.org>
<lmesnik@openjdk.org>
<sspitsyn@openjdk.org>
<cjplummer@openjdk.org>
<coleenp@openjdk.org>
<rehn@openjdk.org>
<stefank@openjdk.org>
<tschatzl@openjdk.org>
<skuksenko@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8166/head:pull/8166
$ git checkout pull/8166
Update a local copy of the PR:
$ git checkout pull/8166
$ git pull https://git.openjdk.java.net/jdk pull/8166/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 8166
View PR using the GUI difftool:
$ git pr show -t 8166
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8166.diff