[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-runtime-dev
Subject:    Re: RFR: 8286302: Port JEP 425 to PPC64 [v10]
From:       Richard Reingruber <rrich () openjdk ! org>
Date:       2022-11-25 11:13:31
Message-ID: dzHV-xNL1cWdxLoXXckSIvsnTMlpWE--XNl8QWAssyA=.10d4e546-6c95-4191-9e5a-46fa4f9b798c () github ! com
[Download RAW message or body]

On Thu, 24 Nov 2022 13:56:06 GMT, Richard Reingruber <rrich@openjdk.org> wrote:

> > Hi,
> > 
> > this is the port of [JEP 425: Virtual Threads \
> > (Preview)](https://openjdk.org/jeps/425)) to PPC64. More precisely it is the port \
> > of vm continuations in hotspot to PPC64. It allows to run with \
> > `-XX:+VMContinuations` which is a prerequisit for 'real' virtual threads \
> > (oxymoron?). 
> > Most of the shared code changes are related to a new platform dependent constant \
> > `frame::metadata_words_at_top`. It is either added or subtracted to a frame \
> > address or size. 
> > The following is supposed to explain (without real life details) why it is needed \
> > in addition to the existing `frame::metadata_words`. The diagram shows a frame at \
> > `SP` and its stack arguments. The caller frame is located at `callers_SP`. 
> > 
> > X86 / AARCH64                             PPC64:
> > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > -----------------|                       |-----------------|
> > > > > > 
> > > stack arguments |                       | stack arguments |
> > > > <- callers_SP          |                 |
> > ===================                       |-----------------|
> > > > > > 
> > > metadata@bottom |                       | metadata@top    |
> > > > > > <- callers_SP
> > > -----------------|                       ===================
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > <- SP                  |                 |
> > ===================                       |-----------------|
> > > > 
> > > metadata@top    |
> > > > <- SP
> > ===================
> > 
> > 
> > On X86 and AARCH64 metadata (that's return address, saved SP/FP, etc.) is stored \
> > at the frame bottom (`metadata@bottom`). On PPC64 it is stored at the frame top \
> > (`metadata@top`) where it affects size and address calculations. Shared code \
> > deals with this by making use of the platform dependent constant \
> > `frame::metadata_words_at_top`. 
> > * size required to 'freeze' a single frame with its stack arguments in a \
> > `StackChunk`: `sizeof(frame) + sizeof(stack arguments) + \
> > frame::metadata_words_at_top` 
> > * address of stack arguments:
> > `callers_SP + frame::metadata_words_at_top`
> > 
> > * The value of `frame::metadata_words_at_top` is 0 words on X86 and AARCH64. On \
> > PPC64 it is 4 words. 
> > Please refer to comments I've added for more details (e.g. the comment on \
> > StackChunkFrameStream<frame_kind>::frame_size()). Recently I've given a talk \
> > about vm continuations and the PPC64 port to my colleagues. It's rather an \
> > overview than a deep dive. [The \
> > slides](http://cr.openjdk.java.net/~rrich/webrevs/2022/8286302/202210_loom_ppc64_port.pdf) \
> > might serve as well as an intro to the matter. 
> > The pr includes the new test jdk/jdk/internal/vm/Continuation/BasicExp.java which \
> > I wrote while doing the port. The test cases vary from simple to not-so-simple. \
> > One of the main features is that a CompilationPolicy passed as argument controls \
> > which frames are compiled/interpreted when freezing by defining a sliding window \
> > of compiled / interpreted frames which produces interesting transitions with and \
> > without stack arguments. There is overlap with Basic.java and Fuzz.java. Let me \
> > know wether to remove or keep BasicExp.java. Runtime with fastdebug: 2m on Apple \
> > M1 Pro and 3m on Intel Xeon E5-2660 v3 @ 2.60GHz. Note that \
> > -XX:+VerifyContinuations is explicitly set as a found it very useful, it \
> > increases the runtime quite a bit though. 
> > Testing: the change passed our CI testing: most JCK and JTREG tests, also in \
> > Xcomp mode, SPECjvm2008, SPECjbb2015, Renaissance Suite and SAP specific tests \
> > with fastdebug and release builds on the standard platforms plus PPC64. These \
> > tests do include hotspot_loom and jdk_loom JTREG tests which I've also run with \
> > TEST_VM_OPTS="-XX:+VerifyContinuations" on X86_64, PPC64, and AARCH64. 
> > Thanks, Richard.
> 
> Richard Reingruber has updated the pull request with a new target base due to a \
> merge or a rebase. The pull request now contains 12 commits: 
> - Merge branch 'master' into 8286302_Port_JEP_425_to_PPC64
> - More Feedback Leonid
> - Feedback Leonid
> - Cleanup BasicExp test
> - Feedback Martin
> - Cleanup BasicExp.java
> - Feedback from backwaterred
> - Fix cpp condition and add PPC64
> - Changes lost in merge
> - Merge branch 'master' into 8286302_Port_JEP_425_to_PPC64
> - ... and 2 more: https://git.openjdk.org/jdk/compare/9c77e41b...0b7e325b

Thanks a lot for the reviews and feedback!
My own testing and GHA have succeeded after merging master.
I'm intending to integrate the port on Monday since I don't expect more feedback.

-------------

PR: https://git.openjdk.org/jdk/pull/10961


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic