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

8253270: Limit fastdebug inlining in G1 evacuation #220

Closed
wants to merge 2 commits into from

Conversation

kimbarrett
Copy link

@kimbarrett kimbarrett commented Sep 17, 2020

Please review this change to G1 evacuation to prevent inlining of some functions in debug (particularly, fastdebug) builds. This reduces the size of the generated code to stay away from limits encountered with gcc when compiling for aarch64. As a side benefit, this adds more call frames that might be helpful with debugging.

Testing: tier1
Verified expected inlining on linux-x64 and linux-aarch64 in both release and fastdebug builds.


Progress

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

Issue

  • JDK-8253270: Limit fastdebug inlining in G1 evacuation

Reviewers

Download

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

@kimbarrett kimbarrett changed the title noinline some functions in debug builds 8253270: Limit fastdebug inlining in G1 evacuation Sep 17, 2020
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 17, 2020

👋 Welcome back kbarrett! 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 Sep 17, 2020

@kimbarrett The following label will be automatically applied to this pull request: hotspot-gc.

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 (add|remove) "label" command.

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Sep 17, 2020
@kimbarrett kimbarrett marked this pull request as ready for review September 17, 2020 08:38
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 17, 2020
@mlbridge
Copy link

mlbridge bot commented Sep 17, 2020

Webrevs

Copy link
Contributor

@tschatzl tschatzl left a comment

Choose a reason for hiding this comment

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

Lgtm.

@openjdk
Copy link

openjdk bot commented Sep 17, 2020

@kimbarrett This change now passes all automated pre-integration checks. In addition to the automated checks, the change must also fulfill all project specific requirements

After integration, the commit message will be:

8253270: Limit fastdebug inlining in G1 evacuation

Reviewed-by: tschatzl, sjohanss, ayang
  • If you would like to add a summary, use the /summary command.
  • To credit additional contributors, use the /contributor command.
  • To add additional solved issues, use the /issue command.

Since the source branch of this PR was last updated there have been 28 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 automatic rebasing, please merge master into your branch, and then specify the current head hash when integrating, like this: /integrate 89044200cd1eb8ab7747c8861320a291772b3dd3.

➡️ 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 Sep 17, 2020
@albertnetymk
Copy link
Member

If this workaround is needed due to a compiler bug, I think it's best to include a reference to the corresponding compiler ticket(s) so that it's possible to undo this workaround when the bug is fixed. On second thought, I wonder if it's feasible to just raise the required compiler version, assuming this bug is fixed in later versions of gcc.

@mlbridge
Copy link

mlbridge bot commented Sep 17, 2020

Mailing list message from Kim Barrett on hotspot-gc-dev:

On Sep 17, 2020, at 5:01 AM, Albert Mingkun Yang <ayang at openjdk.java.net> wrote:

On Thu, 17 Sep 2020 08:55:08 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

Please review this change to G1 evacuation to prevent inlining of some functions in debug (particularly, fastdebug)
builds. This reduces the size of the generated code to stay away from limits encountered with gcc when compiling for
aarch64. As a side benefit, this adds more call frames that might be helpful with debugging. Testing: tier1
Verified expected inlining on linux-x64 and linux-aarch64 in both release and fastdebug builds.

Lgtm.

If this workaround is needed due to a compiler bug, I think it's best to include a reference to the corresponding
compiler ticket(s) so that it's possible to undo this workaround when the bug is fixed.

I looked for an existing bug report in gcc's bug tracker, but didn't find
one. It might have been reported in some other aarch64-focused tracker. I
didn't spend too much time looking.

I think the change is reasonable to leave in place permanently. It does
have the mentioned side benefit. It also speeds up compilation of that file
in fastdebug builds by a noticeable amount. (The fastdebug output file
is *huge*.)

On second thought, I wonder if
it's feasible to just raise the required compiler version, assuming this bug is fixed in later versions of gcc.

The JDK-8253169 failure occurs with gcc9.2, but not with gcc10.2, so may
have been fixed already. Or maybe some other code generation change caused
the problem limit to not be reached with the later compiler. I'm in favor
of reporting bugs upstream when they are found, but this one doesn't seem
likely to be worth the effort.

Increasing the mininum required gcc version for linux-aarch64 to 10.x
doesn't seem reasonable at this time, without a much better reason than this.

Copy link
Contributor

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

@mlbridge
Copy link

mlbridge bot commented Sep 17, 2020

Mailing list message from Kim Barrett on hotspot-gc-dev:

On Sep 17, 2020, at 4:58 AM, Thomas Schatzl <tschatzl at openjdk.java.net> wrote:

On Thu, 17 Sep 2020 08:26:06 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

Please review this change to G1 evacuation to prevent inlining of some functions in debug (particularly, fastdebug)
builds. This reduces the size of the generated code to stay away from limits encountered with gcc when compiling for
aarch64. As a side benefit, this adds more call frames that might be helpful with debugging. Testing: tier1
Verified expected inlining on linux-x64 and linux-aarch64 in both release and fastdebug builds.

Lgtm.

Thanks.

@albertnetymk
Copy link
Member

It also speeds up compilation of that file in fastdebug builds by a noticeable amount.

I see; I believe this is worth mentioning in the comments; sth like these functions should be inlined for performance reasons in release build, and should not be inlined for faster-build reasons in debug build. IOW, this new macro is not only a workaround for compiler bugs but a deliberate choice for certain purposes, which justifies its long-term presence.

The JDK-8253169 failure occurs with gcc9.2, but not with gcc10.2, so may have been fixed already.

I see; thank you for the info.

Increasing the mininum required gcc version for linux-aarch64 to 10.x doesn't seem reasonable at this time, without a much better reason than this.

OK.

@mlbridge
Copy link

mlbridge bot commented Sep 17, 2020

Mailing list message from Kim Barrett on hotspot-gc-dev:

On Sep 17, 2020, at 5:19 AM, Stefan Johansson <sjohanss at openjdk.java.net> wrote:

On Thu, 17 Sep 2020 08:26:06 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

Please review this change to G1 evacuation to prevent inlining of some functions in debug (particularly, fastdebug)
builds. This reduces the size of the generated code to stay away from limits encountered with gcc when compiling for
aarch64. As a side benefit, this adds more call frames that might be helpful with debugging. Testing: tier1
Verified expected inlining on linux-x64 and linux-aarch64 in both release and fastdebug builds.

Looks good.

Thanks.

@mlbridge
Copy link

mlbridge bot commented Sep 17, 2020

Mailing list message from Kim Barrett on hotspot-gc-dev:

On Sep 17, 2020, at 5:45 AM, Albert Mingkun Yang <ayang at openjdk.java.net> wrote:

It also speeds up compilation of that file in fastdebug builds by a noticeable amount.

I see; I believe this is worth mentioning in the comments; sth like these functions should be inlined for performance
reasons in release build, and should *not* be inlined for faster-build reasons in debug build. IOW, this new macro is
not only a workaround for compiler bugs but a deliberate choice for certain purposes, which justifies its long-term
presence.

Done.

Copy link
Member

@albertnetymk albertnetymk left a comment

Choose a reason for hiding this comment

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

Thank you.

@mlbridge
Copy link

mlbridge bot commented Sep 17, 2020

Mailing list message from Thomas Schatzl on hotspot-gc-dev:

Hi,

On 17.09.20 13:29, Kim Barrett wrote:

On Sep 17, 2020, at 5:45 AM, Albert Mingkun Yang <ayang at openjdk.java.net> wrote:

It also speeds up compilation of that file in fastdebug builds by a noticeable amount.

I see; I believe this is worth mentioning in the comments; sth like these functions should be inlined for performance
reasons in release build, and should *not* be inlined for faster-build reasons in debug build. IOW, this new macro is
not only a workaround for compiler bugs but a deliberate choice for certain purposes, which justifies its long-term
presence.

Done.

still good :)

Thomas

@mlbridge
Copy link

mlbridge bot commented Sep 17, 2020

Mailing list message from Kim Barrett on hotspot-gc-dev:

Thanks.

Copy link
Contributor

@kstefanj kstefanj left a comment

Choose a reason for hiding this comment

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

Still good.

@kimbarrett
Copy link
Author

/integrate

@openjdk openjdk bot closed this Sep 18, 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 Sep 18, 2020
@openjdk
Copy link

openjdk bot commented Sep 18, 2020

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

Your commit was automatically rebased without conflicts.

Pushed as commit f37c34d.

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

@kimbarrett kimbarrett deleted the limit_inline branch September 18, 2020 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated
4 participants