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

8294037: Using alias template to unify hashtables in AsyncLogWriter #10350

Closed
wants to merge 1 commit into from

Conversation

navyxliu
Copy link
Member

@navyxliu navyxliu commented Sep 19, 2022

This change is only for clear code. No functional change is intended.

Currently, there are two hashtables. One is this on c-heap.

  using AsyncLogMap = ResourceHashtable<LogFileStreamOutput*,
                          uint32_t,
                          17, /*table_size*/
                          ResourceObj::C_HEAP,
                          mtLogging>;

and the other one is its mirror on ResourceArena. It's not accident. The 2nd one is the snapshot of prior one.
We use this approach to release lock early. Flushing snapshot doesn't require lock protection and therefore
won't block logsites.

  ResourceMark rm;
  // Similar to AsyncLogMap but on resource_area
  ResourceHashtable<LogFileStreamOutput*, uint32_t,
                          17/*table_size*/, ResourceObj::RESOURCE_AREA,
                          mtLogging> snapshot;

C++11 has a new feature called alias template. We can
use this feature to unify two types.


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-8294037: Using alias template to unify hashtables in AsyncLogWriter

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10350

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 19, 2022

👋 Welcome back xliu! 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 Sep 19, 2022
@openjdk
Copy link

openjdk bot commented Sep 19, 2022

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

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label Sep 19, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 19, 2022

Webrevs

@openjdk
Copy link

openjdk bot commented Sep 21, 2022

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

8294037: Using alias template to unify hashtables in AsyncLogWriter

Reviewed-by: coleenp, simonis

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

  • 3fa6778: 8292296: Use multiple threads to process ParallelGC deferred updates
  • 800e68d: 8292044: HttpClient doesn't handle 102 or 103 properly
  • 83abfa5: 8255670: Improve C2's detection of modified nodes
  • 5652030: 8292376: A few Swing methods use inheritDoc on exceptions which are not inherited
  • 03f287d: 8293995: Problem list sun/tools/jstatd/TestJstatdRmiPort.java on all platforms because of 8293577
  • d5bee4a: 8294086: RISC-V: Cleanup InstructionMark usages in the backend
  • 47f233a: 8292202: modules_do is called without Module_lock
  • 742bc04: 8294100: RISC-V: Move rt_call and xxx_move from SharedRuntime to MacroAssembler
  • 2283c32: 8294149: JMH 1.34 and later requires jopt-simple 5.0.4
  • 9f90eb0: 8294062: Improve parsing performance of j.l.c.MethodTypeDesc
  • ... and 37 more: https://git.openjdk.org/jdk/compare/8ff2c2639e6843333cf220d4427799e21d366764...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 21, 2022
Copy link
Member

@simonis simonis left a comment

Choose a reason for hiding this comment

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

Thanks for teaching us new C++ features :)

This change looks good and like a nice cleanup. Also verified that at least VSC/ccls can handle it nicely.

@navyxliu
Copy link
Member Author

hi, @coleenp and @simonis ,
thank you for reviewing this patch!

@navyxliu
Copy link
Member Author

/integrated

@openjdk
Copy link

openjdk bot commented Sep 22, 2022

@navyxliu Unknown command integrated - for a list of valid commands use /help.

@navyxliu
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 22, 2022

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

  • 48cc156: 8293331: Refactor FileDispatcherImpl into operating system-specific components
  • f751e60: 8294197: Zero: JVM_handle_linux_signal should not assume deopt NOPs
  • 4a6060b: 8294190: Incorrect check messages in SharedRuntime::generate_uncommon_trap_blob
  • 0be2b2c: 8292756: java.lang.AssertionError at at jdk.compiler/com.sun.tools.javac.code.Scope$ScopeImpl.leave(Scope.java:386)
  • bc2af47: 8254711: Add java.security.Provider.getService JFR Event
  • d781ab0: 8294003: Don't handle si_addr == 0 && si_code == SI_KERNEL SIGSEGVs
  • a216960: 8294087: RISC-V: RVC: Fix a potential alignment issue and add more alignment assertions for the patchable calls/nops
  • 3fa6778: 8292296: Use multiple threads to process ParallelGC deferred updates
  • 800e68d: 8292044: HttpClient doesn't handle 102 or 103 properly
  • 83abfa5: 8255670: Improve C2's detection of modified nodes
  • ... and 44 more: https://git.openjdk.org/jdk/compare/8ff2c2639e6843333cf220d4427799e21d366764...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 22, 2022

@navyxliu Pushed as commit 696287d.

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