RFR: 8290177: Improve documentation in G1MMUTracker

Albert Mingkun Yang ayang at openjdk.org
Thu Jul 14 09:28:04 UTC 2022


On Tue, 12 Jul 2022 14:48:09 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   please review this change to improve the naming and documentation in `G1MMUTracker::when_sec`. Recently we have been looking at some young gen sizing issues (for another time), and it took some time to understand what the code does and how it works. This is kind of the result of this internal discussion, but I'm open to improve this further.
> 
> Testing: gha
> 
> Thanks,
>   Thomas

Some minor comments.

src/hotspot/share/gc/g1/g1MMUTracker.cpp line 59:

> 57: }
> 58: 
> 59: double G1MMUTracker::calculate_gc_time(double time_stamp) {

I think `current_timestamp` reads better; in this file/context `X_time` is (often) used to mean a duration. Keeping the `current` prefix helps also; from the callee's perspective, the arg represents "now".

src/hotspot/share/gc/g1/g1MMUTracker.hpp line 113:

> 111: 
> 112:   // Determines how many seconds relative to current_time a pause of pause_time length
> 113:   // would fit the MMU.

What I have in mind is sth like "Distance to the upcoming earliest possible GC pause without violating the MMU constraint. The return value is measured in seconds."

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

Marked as reviewed by ayang (Reviewer).

PR: https://git.openjdk.org/jdk/pull/9471



More information about the hotspot-gc-dev mailing list