RFR: 8229517: Support for optional asynchronous/buffered logging [v13]

Xin Liu xliu at openjdk.java.net
Wed May 12 08:02:46 UTC 2021


> This patch provides a buffer to store asynchrounous messages and flush them to
> underlying files periodically.

Xin Liu has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 27 commits:

 - Update based on the feedbacks from reviwers.
   
   Since I have incorporated in JDK-8266503, store LogDecoration by value in
   AsyncLogMessage.
   Remove AsyncLogMessage::destroy()
   change dropped message counters to uint32_t.
   Add more comments.
 - Merge branch 'master' into JDK-8229517
 - Change option AsyncLogBufferEntries to AsyncLogBufferSize.
   
   AsyncLogBufferSize is the memory budget in bytes for Asynchronous Logging.
   User can specify it in shorthand form. eg. -XX:AsyncLogBufferSize=10M.
 - Use LogTagSetMapping<LogTag::__NO_TAG>::tagset() instead of NULL pointer.
 - Implement the global option -Xlog:async per CSR.
   
   The old options -XX:+AsyncLogging and the output option are both removed.
   This patch also deliver the zero-cost promise. ie. No AsyncLog thread will be
   launched if async_mode is not eanbled.
 - Reimplement Accurate Decorations for AsyncLogging.
   
   LogDecorations defines a copy constructutor. Each log message copys it
   once.
 - Revert "Accurate Decorations for AsyncLogging."
   
   This reverts commit 1f06be3126f829055aff3720aea7e82544fd0c3a.
 - Fix bugs/style/typo based on reviewers' feedbacks.
 - Accurate Decorations for AsyncLogging.
   
   A lightweight LogDecorationRef is created to keep LogDecorations at
   logging site. It uses refcnt to keep track multiple usage and
   automatically clean up. If no decorator is in use, no LogDecorationRef
   is created.
 - Refactor LogAsyncFlusher::abort()
   
   This change makes sure LogAsyncFlusher::abort() is lock-less.
   Therefore, it's not subject to mutex rank issue. Newly added
   gtest(mutex_lock_access_leaf)  may deliberately trigger SIGSEGV
   while holding access rank mutex, so abort() must be lockless.
 - ... and 17 more: https://git.openjdk.java.net/jdk/compare/04fad704...908d2a36

-------------

Changes: https://git.openjdk.java.net/jdk/pull/3135/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3135&range=12
  Stats: 735 lines in 22 files changed: 721 ins; 5 del; 9 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3135.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3135/head:pull/3135

PR: https://git.openjdk.java.net/jdk/pull/3135


More information about the hotspot-dev mailing list