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

8051680: (ref) unnecessary process_soft_ref_reconsider #4667

Closed
wants to merge 4 commits into from

Conversation

albertnetymk
Copy link
Member

@albertnetymk albertnetymk commented Jul 2, 2021

This PR consists of 3 commits:

  1. Removes the soft-ref reconsideration phase because the soft-ref policy is set before marking (JDK-8269596) and stays the same across the GC cycle. Reconsideration phase should not find anything interesting. That being said, there might be some benefit of using more precise heap usage after marking for soft-ref processing, created JDK-8269798 for exploring that.

  2. Removes reloading of _soft_ref_timestamp_clock from java_lang_ref_SoftReference::clock(); because the master clock should only be changed by GC.

  3. Rename phase{2,3,4} to phase{1,2,3}.

Test: hotspot_gc


Progress

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

Issue

  • JDK-8051680: (ref) unnecessary process_soft_ref_reconsider

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4667

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 2, 2021

👋 Welcome back ayang! 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 Jul 2, 2021
@openjdk
Copy link

openjdk bot commented Jul 2, 2021

@albertnetymk 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 Jul 2, 2021
@mlbridge
Copy link

mlbridge bot commented Jul 2, 2021

Webrevs

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.

The first two commits look good.

As for the 3rd (phase renumbering) commit, if we're going to do all this
renaming, I'd prefer the new names were semantically meaningful, rather than
just Phase1,2,3,4. Unfortunately that didn't happen either in or as a
followup to JDK-8202845.

@albertnetymk
Copy link
Member Author

Names and responsibility of various phases:

  enum RefProcSubPhases {
    SoftRefSubPhase1,
    WeakRefSubPhase1,
    FinalRefSubPhase1,
    FinalRefSubPhase2,
    PhantomRefSubPhase3,
    RefSubPhaseMax
  };

  enum RefProcPhases {
    RefPhase1,
    RefPhase2,
    RefPhase3,
    RefPhaseMax
  };
  
  // Phase 1: Drop Soft/Weak/Final references with a NULL or live referent, and clear
  // and enqueue non-Final references.
  void process_soft_weak_final_refs(RefProcProxyTask& proxy_task,
                                    ReferenceProcessorPhaseTimes& phase_times);

  // Phase 2: Keep alive followers of Final references, and enqueue.
  void process_final_keep_alive(RefProcProxyTask& proxy_task,
                                ReferenceProcessorPhaseTimes& phase_times);

  // Phase 3: Drop and keep alive live Phantom references, or clear and enqueue if dead.
  void process_phantom_refs(RefProcProxyTask& proxy_task,
                            ReferenceProcessorPhaseTimes& phase_times);

Kim's suggestion:

Process{Soft,Weak,Final}RefsSubPhase, KeepAliveFinalRefsSubPhase, ProcessPhantomRefsSubPhase

SoftWeakFinalRefsPhase, KeepAliveFinalRefsPhase, PhantomRefsPhase

Given such renaming is quite invasive, maybe it can be done in a separate PR. So which option do reviewers think is the best to take?

  1. create a revert for the third commit, leaving renaming to another PR. (The phases will start from "2" in the logs.)
  2. make semantic renaming in this PR. (Mixing real changes with large renaming.)

@kimbarrett
Copy link

I would prefer to have the renaming done in a separate PR.

This reverts commit 740e185.
@albertnetymk
Copy link
Member Author

I have reverted the renaming commit; this PR effectively contains only the first two commits.

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.

@openjdk
Copy link

openjdk bot commented Jul 9, 2021

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

8051680: (ref) unnecessary process_soft_ref_reconsider

Reviewed-by: kbarrett, tschatzl

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

  • ac75a53: 8253779: Amalloc may be wasting space by overaligning
  • 68b6e11: 8270083: -Wnonnull errors happen with GCC 11.1.1
  • ec975c6: Merge
  • 6889a39: 8268826: Cleanup Override in Context-Specific Deserialization Filters
  • f791fdf: 8261147: C2: Node is wrongly marked as reduction resulting in a wrong execution due to wrong vector instructions
  • 1196b35: 8270151: IncompatibleClassChangeError on empty pattern switch statement case
  • 885f7b1: 8269146: Missing unreported constraints on pattern and other case label combination
  • 62ff55d: 8269952: compiler/vectorapi/VectorCastShape*Test.java tests failed on avx2 machines
  • 46c610c: 8269840: Update Platform.isDefaultCDSArchiveSupported() to return true for aarch64 platforms
  • d6c0f5f: 8270059: Remove KVHashtable
  • ... and 97 more: https://git.openjdk.java.net/jdk/compare/f8bcbf0172af25ac17b110d22232bd618cfd621a...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 Jul 9, 2021
@albertnetymk
Copy link
Member Author

Thanks for the review.

/integrate

@openjdk
Copy link

openjdk bot commented Jul 12, 2021

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

  • ac75a53: 8253779: Amalloc may be wasting space by overaligning
  • 68b6e11: 8270083: -Wnonnull errors happen with GCC 11.1.1
  • ec975c6: Merge
  • 6889a39: 8268826: Cleanup Override in Context-Specific Deserialization Filters
  • f791fdf: 8261147: C2: Node is wrongly marked as reduction resulting in a wrong execution due to wrong vector instructions
  • 1196b35: 8270151: IncompatibleClassChangeError on empty pattern switch statement case
  • 885f7b1: 8269146: Missing unreported constraints on pattern and other case label combination
  • 62ff55d: 8269952: compiler/vectorapi/VectorCastShape*Test.java tests failed on avx2 machines
  • 46c610c: 8269840: Update Platform.isDefaultCDSArchiveSupported() to return true for aarch64 platforms
  • d6c0f5f: 8270059: Remove KVHashtable
  • ... and 97 more: https://git.openjdk.java.net/jdk/compare/f8bcbf0172af25ac17b110d22232bd618cfd621a...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 12, 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 Jul 12, 2021
@albertnetymk albertnetymk deleted the phase1 branch July 12, 2021 07:53
@openjdk
Copy link

openjdk bot commented Jul 12, 2021

@albertnetymk Pushed as commit 86a2008.

💡 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