-
Notifications
You must be signed in to change notification settings - Fork 41
8369566: CRaC: Record metrics during checkpoint #269
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
Conversation
|
👋 Welcome back rvansa! A progress list of the required criteria for merging this PR into |
|
@rvansa 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: 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 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
|
It seems that the |
|
@TimPushkin I've piggy-backed a fix in |
|
@rvansa I'll try to look today, if the time allows; otherwise, I'll look tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be some way for the user to know which metrics are available because the names will be needed to write a selection policy. Ideally some documentation for the value ranges is also needed.
src/java.base/share/classes/jdk/internal/crac/mirror/impl/GlobalContext.java
Outdated
Show resolved
Hide resolved
| return false; | ||
| } | ||
| _score.foreach([&](const Score& score){ | ||
| fprintf(f, "%s=%f\n", score._name, score._value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no validation that = and \n are not present in the name so there will probably be problems with parsing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for =, you can easily say that the last = is the separator. The \n is user shooting himself into foot.
However in general, this format (and its limitations) is engine-specific and there is no way to report the unsuitability. When the score is reported on Java level, the engine is not consulted yet, and later on we could only fail the checkpoint, which seems excessive to me.
If you want, I can truncate the metric name at first \n when recording it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot that the value is not a generic string. With that = is indeed not a problem, for \n we can truncate with a warning.
|
@TimPushkin I've added the test, and changed the way how the global context size is reported in scores: We have reported the practically constant version of internal global context, not the other (!) global context exposed to the user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe after our internal discussions we've decided to document the format of crexec's score output somewhere?
src/java.base/share/classes/jdk/internal/crac/mirror/impl/GlobalContext.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/jdk/internal/crac/mirror/impl/GlobalContext.java
Show resolved
Hide resolved
| private static void setJdkResourceScore() { | ||
| int resources = 0; | ||
| for (var p : Core.Priority.values()) { | ||
| if (p.getContext() instanceof OrderedContext<?> octx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a cast just to ensure we don't miss a resource, but for now this should be equivalent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core.Priority.SCORE.getContext() is not an OrderedContext.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could check p != Core.Priority.SCORE then. I am suggesting this because it'll make sure we won't miss resources if we add some other type of context in the future. But if you think this is unlikely, I'm OK to leave it as is.
|
/integrate |
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.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/crac.git pull/269/head:pull/269$ git checkout pull/269Update a local copy of the PR:
$ git checkout pull/269$ git pull https://git.openjdk.org/crac.git pull/269/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 269View PR using the GUI difftool:
$ git pr show -t 269Using diff file
Download this PR as a diff file:
https://git.openjdk.org/crac/pull/269.diff
Using Webrev
Link to Webrev Comment