Skip to content

8360776: Disable Intel APX by default and enable it with -XX:+UnlockExperimentalVMOptions -XX:+UseAPX in all builds #26029

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vamsi-parasa
Copy link
Contributor

@vamsi-parasa vamsi-parasa commented Jun 27, 2025

Currently, APX is not enabled consistently between product and debug builds.

If the hardware supports Intel APX:

  1. In product builds, APX is disabled by default, even if the user explicitly enables it using -XX:+UnlockExperimentalVMOptions -XX:+UseAPX.

  2. In debug builds, APX is enabled by default regardless of whether the user explicitly enables it or not.

The goal of this PR is to enable APX for both product and debug builds if and only if the user explicitly enables it using -XX:+UnlockExperimentalVMOptions -XX:+UseAPX.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8360776: Disable Intel APX by default and enable it with -XX:+UnlockExperimentalVMOptions -XX:+UseAPX in all builds (Enhancement - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26029/head:pull/26029
$ git checkout pull/26029

Update a local copy of the PR:
$ git checkout pull/26029
$ git pull https://git.openjdk.org/jdk.git pull/26029/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26029

View PR using the GUI difftool:
$ git pr show -t 26029

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26029.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 27, 2025

👋 Welcome back sparasa! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 27, 2025

@vamsi-parasa 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:

8360776: Disable Intel APX by default and enable it with -XX:+UnlockExperimentalVMOptions -XX:+UseAPX in all builds

Reviewed-by: sviswanathan, dholmes, jbhateja

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 50 new commits pushed to the master branch:

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@sviswa7, @dholmes-ora, @jatin-bhateja) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 27, 2025
@openjdk
Copy link

openjdk bot commented Jun 27, 2025

@vamsi-parasa The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Jun 27, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 27, 2025

Webrevs

@jatin-bhateja
Copy link
Member

jatin-bhateja commented Jun 28, 2025

Please change the title as "8360776: Enable -XX+UseAPX as Experiminatal feature in all builds"

We should also backport it to JDK-25 before RDP2

@@ -429,7 +429,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
stub = VM_Version::cpuinfo_cont_addr();
}

#if !defined(PRODUCT) && defined(_LP64)
#if defined(_LP64)
Copy link
Member

Choose a reason for hiding this comment

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

Is it still required after the removal of the 32-bit port of x86?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pls see the #if defined(_LP64) check removed in the updated code.

@@ -255,7 +255,7 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
stub = VM_Version::cpuinfo_cont_addr();
}

#if !defined(PRODUCT) && defined(_LP64)
#if defined(_LP64)
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need this after removal of 32-bit port of x86 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pls see the #if defined(_LP64) check removed in the updated code.

@jatin-bhateja
Copy link
Member

Verified patch with the following configurations, we now enable APX only on APX-capable targets with -XX:+UnlockExperimentalVMOptions

CPROMPT>sde64 -dmr -ptr_raise -- java -XX:+PrintFlagsFinal -XX:+UnlockExperimentalVMOptions -XX:-UseAPX --version | grep UseAPX
     bool UseAPX                                   = false                           {ARCH experimental} {command line}
CPROMPT>sde64 -dmr -ptr_raise -- java -XX:+PrintFlagsFinal -XX:+UnlockExperimentalVMOptions -XX:+UseAPX --version | grep UseAPX
     bool UseAPX                                   = true                            {ARCH experimental} {command line}
CPROMPT>sde64 -dmr -ptr_raise -- java -XX:+PrintFlagsFinal -XX:+UnlockExperimentalVMOptions  --version | grep UseAPX
     bool UseAPX                                   = false                           {ARCH experimental} {default}
CPROMPT>sde64 -gnr -ptr_raise -- java -XX:+PrintFlagsFinal -XX:+UnlockExperimentalVMOptions -XX:+UseAPX --version | grep UseAPX
OpenJDK 64-Bit Server VM warning: UseAPX is not supported on this CPU, setting it to false
     bool UseAPX                                   = false                           {ARCH experimental} {command line}
CPROMPT>sde64 -gnr -ptr_raise -- java -XX:+PrintFlagsFinal -XX:+UnlockExperimentalVMOptions -XX:-UseAPX --version | grep UseAPX
     bool UseAPX                                   = false                           {ARCH experimental} {command line}

Comment on lines -3154 to -3155
// Enable APX support for product builds after
// completion of planned features listed in JDK-8329030.
Copy link
Member

@dholmes-ora dholmes-ora Jun 30, 2025

Choose a reason for hiding this comment

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

So you have decided not to follow the original plan ( as JDK-8329030 is not complete) and instead go ahead and enable APX in product mode now. Why? Was this discussed anywhere?

Copy link

Choose a reason for hiding this comment

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

@dholmes-ora The remaining items in JDK-8329030 are nice to have. I will update JDK-8329030 accordingly to reflect this.

@openjdk
Copy link

openjdk bot commented Jun 30, 2025

@vamsi-parasa Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@vamsi-parasa vamsi-parasa changed the title 8360776: Disable Intel APX by default and enable it only if requested by the user using -XX:+UnlockExperimentalVMOptions -XX:+UseAPX 8360776: Enable -XX:+UseAPX as experimental feature in all builds Jun 30, 2025
@vamsi-parasa
Copy link
Contributor Author

Please change the title as "8360776: Enable -XX+UseAPX as Experiminatal feature in all builds"

We should also backport it to JDK-25 before RDP2

Please see the updated title as suggested.

Copy link

@sviswa7 sviswa7 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 30, 2025
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Okay the changes do as described.

Thanks

Copy link
Member

@jatin-bhateja jatin-bhateja left a comment

Choose a reason for hiding this comment

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

LGTM.

Best Regards,
Jatin

@vamsi-parasa vamsi-parasa changed the title 8360776: Enable -XX:+UseAPX as experimental feature in all builds 8360776: Disable Intel APX by default and enable it with -XX:+UnlockExperimentalVMOptions -XX:+UseAPX in all builds Jul 1, 2025
@openjdk openjdk bot changed the title 8360776: Disable Intel APX by default and enable it with -XX:+UnlockExperimentalVMOptions -XX:+UseAPX in all builds 8360776: Disable Intel APX by default and enable it with -XX:+UnlockExperimentalVMOptions -XX:+UseAPX in all builds Jul 1, 2025
@openjdk openjdk bot added ready Pull request is ready to be integrated and removed ready Pull request is ready to be integrated labels Jul 1, 2025
@vamsi-parasa
Copy link
Contributor Author

Hi Emanuel (@eme64),

Would it be possible to test this PR?
Please let me know.

Thanks,
Vamsi

@TobiHartmann
Copy link
Member

I submitted testing for this and will report back once it passed.

@TobiHartmann
Copy link
Member

TobiHartmann commented Jul 2, 2025

We should also backport it to JDK-25 before RDP2

Enabling APX as an experimental feature in product feels like an enhancement to me, I therefore converted this from a bug to an RFE. Per JEP 3, this would need approval for being backported to JDK 25 during RDP 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org ready Pull request is ready to be integrated rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

5 participants