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

8263421: Module image file is opened twice during VM startup #3591

Closed
wants to merge 3 commits into from

Conversation

hseigel
Copy link
Member

@hseigel hseigel commented Apr 20, 2021

Please review this fix for JDK-8263421. The fix stores the JImageFile* in a static that gets initialized when lookup_vm_options() opens the module image file. The static JimageFIle* is then used by setup_bootstrap_search_path_impl() when creating the ClassPathImageEntry for the module image file, avoiding having to re-open the module image file.

This fix moved the creation of the ClassPathImageEntry for the module image file from create_class_path_entry() to setup_bootstrap_search_path_impl() because create_class_path_entry() may try to do this multiple times, but the ClassPathImageEntry for the module image file is only actually created once.

The fix also removes some unused code related to module image file processing.

The changes were tested with Mach5 tiers 1 and 2 on Linux, Mac OS, and Windows, and Mach5 tiers 3-
5 on Linux x64.

Thanks, Harold


Progress

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

Issue

  • JDK-8263421: Module image file is opened twice during VM startup

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3591/head:pull/3591
$ git checkout pull/3591

Update a local copy of the PR:
$ git checkout pull/3591
$ git pull https://git.openjdk.java.net/jdk pull/3591/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3591

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3591.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 20, 2021

👋 Welcome back hseigel! 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 Apr 20, 2021
@openjdk
Copy link

openjdk bot commented Apr 20, 2021

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

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label Apr 20, 2021
@mlbridge
Copy link

mlbridge bot commented Apr 20, 2021

Webrevs

Copy link
Member

@iklam iklam 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 overall, but I think we should add some asserts to ensure safety.

@hseigel
Copy link
Member Author

hseigel commented Apr 21, 2021

Thanks Ioi for looking at this change! I added jimage_non_null() and modified ~ClassPathImageEntry() as you suggested. Could you take at these updated changes?

Thanks, Harold

Copy link
Member

@iklam iklam 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 Apr 21, 2021

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

8263421: Module image file is opened twice during VM startup

Reviewed-by: iklam, dholmes

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

  • 7a55914: 8264196: Change link_and_cleanup_shared_classes(CATCH) to CHECK
  • b84f690: 8265793: Remove duplicate jtreg TEST.groups references for some client tests
  • 0e00598: 8265782: Bump bootjdk to jdk-17+19 on macosx-aarch64 at Oracle
  • e81baea: 8265786: ProblemList serviceability/sa/sadebugd/DisableRegistryTest.java on ZGC
  • ca0de26: 8265699: (bf) Scopes passed to ScopedMemoryAccess.copy[Swap]Memory in incorrect order
  • b930bb1: 8265461: G1: Forwarding pointer removal thread sizing
  • f834557: 8258915: Temporary buffer cleanup
  • 31d8a19: 8265105: gc/arguments/TestSelectDefaultGC.java fails when compiler1 is disabled
  • 657f103: 8057543: Replace javac's Filter with Predicate (and lambdas)
  • 8758b55: 8265591: Remove vestiages of intermediate JSR 175 annotation format
  • ... and 48 more: https://git.openjdk.java.net/jdk/compare/4dcaac1feb3e29ad979e4d9eb8a17ab60470b765...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 Apr 21, 2021
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.

Hi Harold,

Generally this looks okay. A couple of minor nits.

Thanks,
David

@hseigel
Copy link
Member Author

hseigel commented Apr 22, 2021

Thanks David for reviewing this. I removed the set_jimage() method and renamed static variable JImage_File to JImage_file.
Harold

@hseigel
Copy link
Member Author

hseigel commented Apr 27, 2021

Thanks Ioi and David for the reviews!

/integrate

@openjdk openjdk bot closed this Apr 27, 2021
@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 Apr 27, 2021
@openjdk
Copy link

openjdk bot commented Apr 27, 2021

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

  • fbfd4ea: 8265914: Duplicated NotANode and not_a_node
  • 9481fad: 8163367: Test javax/swing/JComboBox/8033069/bug8033069NoScrollBar.java javax/swing/JComboBox/8033069/bug8033069ScrollBar.java fails intermittently
  • 9adbf15: 8265995: Shenandoah: Move ShenandoahInitMarkRootsClosure close to its use
  • 879a77f: 8265757: stack-use-after-scope in perfMemory_posix.cpp get_user_name_slow()
  • e4be968: 8265980: Fix systemDictionary and loaderConstraints printing
  • f6e26f6: 8265756: AArch64: initialize memory allocated for locals according to Windows AArch64 stack page growth requirement in template interpreter
  • 0a4c338: 8263432: javac may report an invalid package/class clash on case insensitive filesystems
  • 82b3719: 8265967: Unused NullCheckNode forward declaration in node.hpp
  • 468c847: 8234020: Remove FullGCCount_lock
  • 4785e11: 8264806: Remove the experimental JIT compiler
  • ... and 117 more: https://git.openjdk.java.net/jdk/compare/4dcaac1feb3e29ad979e4d9eb8a17ab60470b765...master

Your commit was automatically rebased without conflicts.

Pushed as commit dc323a9.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants