[crac] RFR: 8369566: CRaC: Record metrics during checkpoint [v6]

Timofei Pushkin tpushkin at openjdk.org
Thu Oct 23 08:56:47 UTC 2025


On Wed, 22 Oct 2025 11:38:18 GMT, Radim Vansa <rvansa at openjdk.org> wrote:

>> CRaC Engine can support storing additional metadata about the image. This can help the infrastructure to further refine the set of feasible images (constrained by CPU architecture and features) and select the image that is expected to perform best.
>
> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add license header

I believe after our internal discussions we've decided to document the format of crexec's score output somewhere?

src/hotspot/share/include/crlib/crlib_image_score.h line 37:

> 35: 
> 36: // API for quantifying image performance. This is a write-only API.
> 37: // The metrics are NOT retained after checkpoint (succesful or not),

Suggestion:

// The metrics are NOT retained after checkpoint (successful or not),

src/java.base/share/classes/jdk/internal/crac/mirror/impl/GlobalContext.java line 73:

> 71:         // and the context created by jdk.crac.Core (the 'user' global context). We won't record score for
> 72:         // the internal context as if registered here, beforeCheckpoint would be called after Core.Priority.SCORE
> 73:         // and the score would not be recorded.

BTW, it could be useful to count the amount of system-registered resources (recursively, not just the size of the top-level context). Same rationale: more resources => the system is "warmer". But I am not sure the usefulness is great enough to actually implement that.

src/java.base/share/classes/jdk/internal/crac/mirror/impl/GlobalContext.java line 77:

> 75:             Score score = new Score(name, ctx);
> 76:             synchronized (scores) {
> 77:                 scores.put(name, score);

Maybe add an assert that this returns null (i.e. the name is new) just in case? Or, since there should be only a single score (for the user global context) maybe the map is redundant?

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

PR Review: https://git.openjdk.org/crac/pull/269#pullrequestreview-3368627153
PR Review Comment: https://git.openjdk.org/crac/pull/269#discussion_r2454211380
PR Review Comment: https://git.openjdk.org/crac/pull/269#discussion_r2454384337
PR Review Comment: https://git.openjdk.org/crac/pull/269#discussion_r2454376723


More information about the crac-dev mailing list