-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8227060: Optimize safepoint cleanup subtask order #9515
Conversation
👋 Welcome back coleenp! A progress list of the required criteria for merging this PR into |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of history here. It seems that some of the point of the original CR has
disappeared. There used to be a use of parallel_java_threads_do at the start
(from JDK-8180932), with the CR suggesting moving that to the end. That
disappeared with JDK-8246476. So some of the point of the CR has gone away.
But ordering the remaining tasks from expensive to cheap is still sensible,
and the new order mostly [*] looks plausible.
A different (pre-existing) problem is that the use of the workers isn't great.
The amount of parallelism is just the workgang's current active_workers()
,
with no regard to how much parallelism we have. Presently the maximum useful
amount of parallelism is the number of subtasks, so 6 (which might easily and
likely be reduced with some pre-checks). So we're going to apply
active_workers
threads (whatever that happens to be at the moment) to a task
which can use only a relatively small and fixed [*] number of threads.
Improving the use of the workgang should be a separate RFE.
[*] JDK-8253180 later (after JDK-8246476) introduced the serial threads_do to
set GC watermarks. Digging into it a bit, that doesn't look obviously
lightweight; I wonder if it should be (should have been) parallelized (and
placed at the end of the work). But that's a separate RFE.
}; | ||
|
||
class ParallelSPCleanupTask : public WorkerTask { | ||
class ParallelCleanupTask : public WorkerTask { | ||
private: | ||
SubTasksDone _subtasks; | ||
uint _num_workers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[pre-existing] _num_workers
seems to no longer be used.
@@ -547,33 +538,23 @@ class ParallelSPCleanupTask : public WorkerTask { | |||
} | |||
}; | |||
|
|||
class SafepointCleanupThreadClosure : public ThreadClosure { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new name doesn't seem to have much more to do with what it does than did the old name. The class definition could be moved to the single point of use and just called "Closure" to avoid needing to come up with a good name :)
@kimbarrett I made your suggested improvements, even though a class in the middle of function looks odd to me. Maybe someday it can be replaced with a lambda. Reran tier1 tests locally. I agree that the problem that this was supposed to solve may be gone now, but if we do resizing and rehashing, it would be good to have that in parallel with the other tasks. The threads are already created, otherwise the cost of creating them would not be worth making this parallel. I can't comment on how much work the lazy stack watermark processing is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. There may be a couple of followup RFEs to be filed; we can discuss those later.
@coleenp 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:
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 44 new commits pushed to the
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thank you, Kim and Patricio! |
Going to push as commit 96a542f.
Your commit was automatically rebased without conflicts. |
Most of the analysis in the CR is for code that's removed, but I found one safepoint cleanup task that's unused. Also the dictionary resizing and symbol/string table rehashing, while rare, could take a long time so I moved them sooner in the list.
Tested with tier1-3.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9515/head:pull/9515
$ git checkout pull/9515
Update a local copy of the PR:
$ git checkout pull/9515
$ git pull https://git.openjdk.org/jdk pull/9515/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9515
View PR using the GUI difftool:
$ git pr show -t 9515
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9515.diff