Skip to content

Conversation

@pliden
Copy link
Contributor

@pliden pliden commented Sep 8, 2021

JDK-8237354 introduced the concept of "foreground work" in WorkGang, as a special case for use by the HeapDumper. I propose that we remove this code, since this special use case can be solved without the need for the concept of "foreground work" in WorkGang.

As far as I can tell, there's no reason why it must be the VM thread that takes on the task of writing the header, iterating over roots, etc. So, in VM_HeapDumper::work(), instead of checking if the current thread is the VM thread we can just check if the worker_id is non-zero. That way, a single worker thread will take on the task of writing the header, iterating over roots, etc, and all other worker threads will continue to call worker_loop().

Testing:

  • Passed Tier1-3
  • Passed multiple runs of test/hotspot/jtreg/serviceability/dcmd/gc/
  • Manually ran jcmd GC.heap_dump with various GCs enabled

Progress

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

Issue

  • JDK-8273482: Remove "foreground work" concept from WorkGang

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5410

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 8, 2021

👋 Welcome back pliden! 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 8, 2021

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

  • hotspot

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 hotspot-dev@openjdk.org label Sep 8, 2021
@pliden
Copy link
Contributor Author

pliden commented Sep 8, 2021

/label add hotspot-gc,serviceability
/label remove hotspot

@openjdk openjdk bot added hotspot-gc hotspot-gc-dev@openjdk.org serviceability serviceability-dev@openjdk.org labels Sep 8, 2021
@openjdk
Copy link

openjdk bot commented Sep 8, 2021

@pliden
The hotspot-gc label was successfully added.

The serviceability label was successfully added.

@openjdk openjdk bot removed the hotspot hotspot-dev@openjdk.org label Sep 8, 2021
@openjdk
Copy link

openjdk bot commented Sep 8, 2021

@pliden
The hotspot label was successfully removed.

@pliden pliden marked this pull request as ready for review September 8, 2021 11:01
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 8, 2021
@mlbridge
Copy link

mlbridge bot commented Sep 8, 2021

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. Thanks a lot for looking into this.

@openjdk
Copy link

openjdk bot commented Sep 8, 2021

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

8273482: Remove "foreground work" concept from WorkGang

Reviewed-by: tschatzl, kbarrett

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

  • 54dee13: 8273188: java/lang/instrument/BootClassPath/BootClassPathTest.sh fails with "FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed"
  • 4020a60: 8273550: Replace os::cgc_thread/pgc_thread with os::gc_thread
  • 185eaca: 8273545: Remove Thread::is_GC_task_thread()
  • dd1209e: 8268885: duplicate checkcast when destination type is not first type of intersection type
  • ef4a532: 8263773: Reenable German localization for builds at Oracle
  • 96614da: 8272903: Missing license header in ArenaAllocator.java
  • e3bda63: 8273489: Zero: Handle UseHeavyMonitors on all monitorenter paths
  • c81690d: 8273498: compiler/c2/Test7179138_1.java timed out
  • 4866eaa: 8273409: Receiver type narrowed by CCP does not always trigger post-parse call devirtualization
  • 5ca26cb: 8273433: Enable parallelism in vmTestbase_nsk_sysdict tests
  • ... and 28 more: https://git.openjdk.java.net/jdk/compare/a66629a464b97176bcdc2ca1150d12df6241dc1c...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 Sep 8, 2021
Copy link

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

@pliden
Copy link
Contributor Author

pliden commented Sep 9, 2021

Patch updated include the removal of a few asserts, as discussed here: http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2021-September/036807.html

@schmelter-sap
Copy link
Contributor

The reason I've added this was, that for the shenandoah GC the heap iteration would run into assertions if not called from the VM thread. Maybe this has changed in the meantime.

@pliden
Copy link
Contributor Author

pliden commented Sep 10, 2021

The reason I've added this was, that for the shenandoah GC the heap iteration would run into assertions if not called from the VM thread. Maybe this has changed in the meantime.

As mentioned in my previous comment. This PR removes those asserts since they were overly strict.

@pliden
Copy link
Contributor Author

pliden commented Sep 10, 2021

Thanks all for reviewing!

/integrate

@openjdk
Copy link

openjdk bot commented Sep 10, 2021

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

  • 2eaf374: 8272698: LoadNode::pin is unused
  • 792281d: 8264517: C2: make MachCallNode::return_value_is_used() only available for x86
  • 70c9e02: 8272148: JDesktopPane:getComponentCount() returns one extra than expected with GTKLookAndFeel
  • 08f0be8: 8272608: java_lang_System::allow_security_manager() doesn't set its initialization flag
  • 2e321dc: 8273528: Avoid ByteArrayOutputStream.toByteArray when converting stream to String
  • 54dee13: 8273188: java/lang/instrument/BootClassPath/BootClassPathTest.sh fails with "FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed"
  • 4020a60: 8273550: Replace os::cgc_thread/pgc_thread with os::gc_thread
  • 185eaca: 8273545: Remove Thread::is_GC_task_thread()
  • dd1209e: 8268885: duplicate checkcast when destination type is not first type of intersection type
  • ef4a532: 8263773: Reenable German localization for builds at Oracle
  • ... and 33 more: https://git.openjdk.java.net/jdk/compare/a66629a464b97176bcdc2ca1150d12df6241dc1c...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 10, 2021

@pliden Pushed as commit c1e39fa.

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

@pliden pliden deleted the 8273482_remove_foreground_work branch September 10, 2021 09:51
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 serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

4 participants