Skip to content
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

8257232: CompileThresholdScaling fails to work on 32-bit platforms #1499

Closed
wants to merge 1 commit into from

Conversation

DamonFool
Copy link
Member

@DamonFool DamonFool commented Nov 28, 2020

Hi all,

CompileThresholdScaling is incorrect on 32-bit platforms.

If you run the following command on Linux-32:

java -XX:CompileThresholdScaling=0.75 -version

It gets the following unexpected warnings:

intx Tier0InvokeNotifyFreqLog=32 is outside the allowed range [ 0 ... 30 ]
intx Tier0BackedgeNotifyFreqLog=32 is outside the allowed range [ 0 ... 30 ]
intx Tier2InvokeNotifyFreqLog=32 is outside the allowed range [ 0 ... 30 ]
intx Tier2BackedgeNotifyFreqLog=32 is outside the allowed range [ 0 ... 30 ]
intx Tier3InvokeNotifyFreqLog=32 is outside the allowed range [ 0 ... 30 ]
intx Tier3BackedgeNotifyFreqLog=32 is outside the allowed range [ 0 ... 30 ]
intx Tier23InlineeNotifyFreqLog=32 is outside the allowed range [ 0 ... 30 ]

The failure is that nth_bit(max_freq_bits) [1] = nth_bit(32) [2] = 0 on 32-bit platforms.
So the scaling logic is wrong.
It would be better to fix it.

Thanks.
Best regards,
Jie

[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/compiler/compilerDefinitions.cpp#L125
[2] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/utilities/globalDefinitions.hpp#L973


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8257232: CompileThresholdScaling fails to work on 32-bit platforms

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1499/head:pull/1499
$ git checkout pull/1499

@DamonFool
Copy link
Member Author

/issue add JDK-8257232
/test
/label add hotspot-compiler
/cc hotspot-compiler

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 28, 2020

👋 Welcome back jiefu! 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 openjdk bot added the rfr Pull request is ready for review label Nov 28, 2020
@openjdk
Copy link

openjdk bot commented Nov 28, 2020

@DamonFool This issue is referenced in the PR title - it will now be updated.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Nov 28, 2020
@openjdk
Copy link

openjdk bot commented Nov 28, 2020

@DamonFool
The hotspot-compiler label was successfully added.

@openjdk
Copy link

openjdk bot commented Nov 28, 2020

@DamonFool The hotspot-compiler label was already applied.

1 similar comment
@openjdk
Copy link

openjdk bot commented Nov 28, 2020

@DamonFool The hotspot-compiler label was already applied.

@mlbridge
Copy link

mlbridge bot commented Nov 28, 2020

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Good.

@openjdk
Copy link

openjdk bot commented Nov 30, 2020

@DamonFool 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:

8257232: CompileThresholdScaling fails to work on 32-bit platforms

Reviewed-by: kvn, redestad

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

  • cfd070e: 8257537: [vector] Cleanup redundant bitwise cases on floating point vectors
  • 03f3b8e: 8210253: Clipped UI rendering with X11 pipeline and HiDPI
  • ce496cb: 8257190: simplify PhaseIdealLoop constructors
  • 927504e: 8256474: Migrate Mutex _owner accesses to use Atomic operations
  • 00e79db: 8257511: JDK-8254082 brings regression to AbstractStringBuilder.insert(int dstOffset, CharSequence s, int start, int end)
  • 015e6e5: 8257460: Further CompilerOracle cleanup
  • 29d90b9: 8255968: Confusing error message for inaccessible constructor
  • c5046ca: 8246739: InputStream.skipNBytes could be implemented more efficiently
  • 56b15fb: 8159746: (proxy) Support for default methods
  • 1433baf: 8253751: Dependencies of automatic modules are not propagated through module layers
  • ... and 46 more: https://git.openjdk.java.net/jdk/compare/c93f0a07c4088ec6c393324e49f32e330f4a58a5...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 30, 2020
@DamonFool
Copy link
Member Author

Good.

Thanks @vnkozlov for your review.

May I get a second review for this change?
Thanks.

Copy link
Member

@cl4es cl4es 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.

Just an idea for a future RFE (one which I might pick up and work on myself): If the multiply-loop-based log2_intptr is a performance issue here, it could probably be optimized by building a variant based on count_leading_zeros. That would require lifting it out from globalDefinitions.hpp, so powerOfTwo.hpp might be a good place.

} else {
return log2_intptr(scaled_freq);
intx res = log2_intptr(scaled_freq);
Copy link
Member

Choose a reason for hiding this comment

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

Could be simplified to return MIN2(log2_intptr(scaled_freq), max_freq_bits);

Copy link
Member Author

Choose a reason for hiding this comment

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

Could be simplified to return MIN2(log2_intptr(scaled_freq), max_freq_bits);

OK.
Will use this kind of code style next time.
Thanks.

@DamonFool
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Dec 2, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 2, 2020
@openjdk
Copy link

openjdk bot commented Dec 2, 2020

@DamonFool Since your change was applied there have been 56 commits pushed to the master branch:

  • cfd070e: 8257537: [vector] Cleanup redundant bitwise cases on floating point vectors
  • 03f3b8e: 8210253: Clipped UI rendering with X11 pipeline and HiDPI
  • ce496cb: 8257190: simplify PhaseIdealLoop constructors
  • 927504e: 8256474: Migrate Mutex _owner accesses to use Atomic operations
  • 00e79db: 8257511: JDK-8254082 brings regression to AbstractStringBuilder.insert(int dstOffset, CharSequence s, int start, int end)
  • 015e6e5: 8257460: Further CompilerOracle cleanup
  • 29d90b9: 8255968: Confusing error message for inaccessible constructor
  • c5046ca: 8246739: InputStream.skipNBytes could be implemented more efficiently
  • 56b15fb: 8159746: (proxy) Support for default methods
  • 1433baf: 8253751: Dependencies of automatic modules are not propagated through module layers
  • ... and 46 more: https://git.openjdk.java.net/jdk/compare/c93f0a07c4088ec6c393324e49f32e330f4a58a5...master

Your commit was automatically rebased without conflicts.

Pushed as commit 8f4fa3f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@DamonFool DamonFool deleted the JDK-8257232 branch December 2, 2020 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
3 participants