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

8290466: Default to --with-source-date=current to avoid unmodified Hotspot recompilation #9638

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Jul 26, 2022

See the bug for symptoms and rationale.

In short, after JDK-8288396 moved the timestamp to CFLAGS_VM_VERSION macro, which changes with every build, we get Hotspot recompilation every time, even when Hotspot is not modified.

I believe current behavior is correct for --with-source-date=updated (current default): you do Hotspot build, you get updated build timestamp, which forces recompilation of affected compilation units, relinkage, re-creation of jmods/jimage. The way out is to switch to --with-source-date=current, which would only get the build timestamp at configure time.

CIs and build farms are likely reconfiguring before every build anyway, so their behavior is unlikely to be affected. But this switch definitely improves the day-to-day OpenJDK development work: it saves >50 seconds on every make for my machine, see below.

Back-to-back unmodified build before:

$ CONF=linux-x86_64-server-release time make hotspot
Building target 'hotspot' in configuration 'linux-x86_64-server-release'
Finished building target 'hotspot' in configuration 'linux-x86_64-server-release'

39.03user 10.97system 0:56.89elapsed 87%CPU (0avgtext+0avgdata 2048944maxresident)k
363616inputs+4108072outputs (484major+1100154minor)pagefaults 0swaps

$ CONF=linux-x86_64-server-release time make hotspot
Building target 'hotspot' in configuration 'linux-x86_64-server-release'
Finished building target 'hotspot' in configuration 'linux-x86_64-server-release'

38.18user 9.02system 0:49.18elapsed 95%CPU (0avgtext+0avgdata 2048788maxresident)k
40inputs+4101112outputs (0major+1100077minor)pagefaults 0swaps

Back-to-back unmodified build after:

$ CONF=linux-x86_64-server-release time make hotspot
Building target 'hotspot' in configuration 'linux-x86_64-server-release'
Finished building target 'hotspot' in configuration 'linux-x86_64-server-release'

2.15user 0.22system 0:02.59elapsed 91%CPU (0avgtext+0avgdata 49480maxresident)k
0inputs+176outputs (0major+55506minor)pagefaults 0swaps

$ CONF=linux-x86_64-server-release time make hotspot
Building target 'hotspot' in configuration 'linux-x86_64-server-release'
Finished building target 'hotspot' in configuration 'linux-x86_64-server-release'

2.18user 0.14system 0:02.46elapsed 94%CPU (0avgtext+0avgdata 49332maxresident)k

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-8290466: Default to --with-source-date=current to avoid unmodified Hotspot recompilation

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9638

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 26, 2022

👋 Welcome back shade! 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 Jul 26, 2022
@openjdk
Copy link

openjdk bot commented Jul 26, 2022

@shipilev The following label will be automatically applied to this pull request:

  • build

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 build build-dev@openjdk.org label Jul 26, 2022
@mlbridge
Copy link

mlbridge bot commented Jul 26, 2022

Webrevs

@openjdk
Copy link

openjdk bot commented Jul 26, 2022

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

8290466: Default to --with-source-date=current to avoid unmodified Hotspot recompilation

Reviewed-by: erikj, ihse

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 master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 Jul 26, 2022
@shipilev
Copy link
Member Author

Any other opinions?

@shipilev
Copy link
Member Author

@magicus -- you are good with this, or?

@magicus
Copy link
Member

magicus commented Jul 29, 2022

Sorry for the slow response, I'm on vacation. 😎

This looks good to me. Just update the default value in the help text as well:

      [how to set SOURCE_DATE_EPOCH ('updated', 'current', 'version' a timestamp or an ISO-8601 date) @<:@current/value of SOURCE_DATE_EPOCH@:>@])],

(github does not allow me to comment on it since it's too far away from any changed lines in the PR)

@shipilev
Copy link
Member Author

Sorry for the slow response, I'm on vacation.

Ah. I seen a few replies from you assumed you are back.

      [how to set SOURCE_DATE_EPOCH ('updated', 'current', 'version' a timestamp or an ISO-8601 date) @<:@current/value of SOURCE_DATE_EPOCH@:>@])],

Good spot, fixed in new commit.

@shipilev
Copy link
Member Author

Entering the week with faster builds.

/integrate

@openjdk
Copy link

openjdk bot commented Jul 31, 2022

Going to push as commit d9cb410.
Since your change was applied there have been 12 commits pushed to the master branch:

  • acbe093: 8291559: x86: compiler/vectorization/TestReverseBitsVector.java fails
  • 32d410a: 8290868: NMT: MallocSiteTable statistics improvements
  • 3579024: 8288904: Incorrect memory ordering in UL
  • 470c0eb: 8290740: Catalog not used when the handler is null
  • dd9bd31: 8289688: jfr command hangs when it processes invalid file
  • 8179a19: 8290243: move seeTagToContent from HtmlDocletWriter to TagletWriterImpl
  • 15943e4: 8282666: nsk/jvmti/PopFrame/popframe004 failed with: TEST FAILED: 30 JVMTI events were generated by the function PopFrame()
  • 0bcf176: 6227536: KeyGenerator.init() methods do not throw IllegalArgumentException for keysize == 0
  • cc2861a: 8290901: Reduce use of -source in langtools tests
  • 64a1a08: 8289647: AssertionError during annotation processing of record related tests
  • ... and 2 more: https://git.openjdk.org/jdk/compare/18cd16d2eae2ee624827eb86621f3a4ffd98fe8c...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 31, 2022
@openjdk openjdk bot closed this Jul 31, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 31, 2022
@openjdk
Copy link

openjdk bot commented Jul 31, 2022

@shipilev Pushed as commit d9cb410.

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

@shipilev shipilev deleted the JDK-8290466-default-source-date-current branch September 5, 2022 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build-dev@openjdk.org integrated Pull request has been integrated
3 participants