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

8329998: Remove double initialization for parts of small TypeArrays in ZObjArrayAllocator #18721

Closed
wants to merge 2 commits into from

Conversation

xmas92
Copy link
Member

@xmas92 xmas92 commented Apr 10, 2024

JDK-8139457 introduced non-word aligned payloads for TypeArrays. This required adaptation in ZObjArrayAllocator segmented array allocator. But the implementation does this adaptation even when the size is small enough and dispatches the allocation to ObjArrayAllocator, which already handles clearing this memory.

Instead move the initialization of any unaligned payload start to after the segmented allocation decision.


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-8329998: Remove double initialization for parts of small TypeArrays in ZObjArrayAllocator (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18721

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 10, 2024

👋 Welcome back aboldtch! 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 Apr 10, 2024

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

8329998: Remove double initialization for parts of small TypeArrays in ZObjArrayAllocator

Reviewed-by: stefank, gli

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 rfr Pull request is ready for review label Apr 10, 2024
@openjdk
Copy link

openjdk bot commented Apr 10, 2024

@xmas92 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 pull request command.

@openjdk openjdk bot added the hotspot-gc hotspot-gc-dev@openjdk.org label Apr 10, 2024
@mlbridge
Copy link

mlbridge bot commented Apr 10, 2024

Webrevs

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 10, 2024
Copy link
Member

@lgxbslgx lgxbslgx 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. One suggestion.

// initialize_memory can only fill word aligned memory,
// fill the first 4 bytes here.
assert(process_start_offset_in_bytes - base_offset_in_bytes == 4, "Must be 4-byte aligned");
assert(!is_reference_type(element_type), "Only TypeArrays can be 4-byte aligned");
Copy link
Member

Choose a reason for hiding this comment

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

Actually, only the type arrays whose element type is not double word can be 4-byte aligned. So this assertion could be !is_reference_type(element_type) && !is_double_word_type(element_type).

Copy link
Member

Choose a reason for hiding this comment

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

I think the point is that when it is not a reference type, it is OK to initialize with a plain 0.

Copy link
Member

Choose a reason for hiding this comment

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

May be better to treat the assertion as a more detailed guard or check. But I'm also OK with the current code.

@xmas92
Copy link
Member Author

xmas92 commented May 16, 2024

Thanks for the reviews. Reran testing after merge.
/integrate

@openjdk
Copy link

openjdk bot commented May 16, 2024

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

  • ee4a9d3: 8321622: ClassFile.verify(byte[] bytes) throws unexpected ConstantPoolException, IAE
  • ab8d7b0: 8324517: C2: crash in compiled code because of dependency on removed range check CastIIs
  • fe8a2af: 8307778: com/sun/jdi/cds tests fail with jtreg's Virtual test thread factory
  • 95f79c6: 8332253: Linux arm32 build fails after 8292591
  • b687aa5: 8332176: Refactor ClassListParser::parse()
  • 4083255: 8316138: Add GlobalSign 2 TLS root certificates
  • 43b109b: 8330066: HeapDumpPath and HeapDumpGzipLevel VM options do not mention HeapDumpBeforeFullGC and HeapDumpAfterFullGC
  • 7cff04f: 8330276: Console methods with explicit Locale
  • 8a4315f: 8331987: Enhance stacktrace clarity for CompletableFuture CancellationException
  • 491b3b4: 8332256: Shenandoah: Do not visit heap threads during shutdown
  • ... and 11 more: https://git.openjdk.org/jdk/compare/c642f44bbe1e4cdbc23496a34ddaae30990ce7c0...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 16, 2024

@xmas92 Pushed as commit 96c5c3f.

💡 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-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants