-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8319955: Improve dependencies removal during class unloading #16639
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
8319955: Improve dependencies removal during class unloading #16639
Conversation
/label add hotspot-runtime |
/label add hotspot-gc |
👋 Welcome back tschatzl! A progress list of the required criteria for merging this PR into |
@tschatzl |
@tschatzl |
So this batches the operation by moving the batch to the purge list, but it doesn't actually release anything. Who/what will process the purge list and when? The implications of this change in terms of concurrent activities is far from clear. |
There is no observable difference (apart from being faster) here - the move of the dependencies from the (single) Klass to the purge list is and has been under the The current basic structure is like:
The only thing that change is the performance of
to
Literally no change in locking or the scope of the The only change is the amount of atomic operations. Actually, the time to hold the The purge list is processed as before at some point afterwards. No change here. Unfortunately the code still needs to traverse the linked list (and there are really many linked lists here and in nmethod management :( ) which are not very amenable to performance improvements (e.g. parallelization). It is a non-goal for this CR to change data structures. |
Sorry forgot to answer this:
There is a call to (During class unloading |
Concurrent additions to the purge list (during (concurrent) class unloading) should be fine due to the This is as before afaict. |
Thanks I can see that now. So all this does is move a chunk of elements to the purge-list instead of doing it one at a time. Makes me wonder why this wasn't noticed sooner. :) |
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.
Changes look good. Thanks
@tschatzl 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 38 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.
Thanks @dholmes-ora @fisk for your reviews |
Going to push as commit fbe1937.
Your commit was automatically rebased without conflicts. |
Hi all,
please review this performance improvement to dependency removal during class unloading: instead of moving the dependencies item by item via a
cmpxchg
, batch this operation.This makes that part of class unloading ~7x faster in my measurements (class unloading stress test, loading/unloading 6k classes).
Testing: tier1-7
Thanks,
Thomas
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16639/head:pull/16639
$ git checkout pull/16639
Update a local copy of the PR:
$ git checkout pull/16639
$ git pull https://git.openjdk.org/jdk.git pull/16639/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16639
View PR using the GUI difftool:
$ git pr show -t 16639
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16639.diff
Webrev
Link to Webrev Comment