8385359: [CRaC] aarch64: c7g.medium <-> c8g.medium FAIL: vector length - #331
jankratochvil wants to merge 79 commits into
Conversation
|
👋 Welcome back jkratochvil! A progress list of the required criteria for merging this PR into |
|
@jankratochvil This change is no longer ready for integration - check the PR body for details. |
|
The image constraints was meant as structured data that is validated by the engine. The check is performed in the engine as to move JVM out of the loop when there are more images and score-based criteria. On the other hand, The only downside of adding @TimPushkin what's your opinion on the suggested API change? |
|
Adding |
|
Nitpick: consider using |
| // Register callbacks before restore. Callbacks are called only during restore. | ||
| // If the callback returns false the restore is aborted. | ||
| // name is not copied, its content must remain valid. | ||
| // user_data is an arbitrary pointer value which is passed along. | ||
| bool (*register_label_hook)(crlib_conf_t *, const char *name, bool (*hook)(const char *value, void *user_data), void *user_data); | ||
| bool (*register_bitmap_hook)(crlib_conf_t *, const char *name, bool (*hook)(const unsigned char *value, size_t value_size, void *user_data), void *user_data); |
There was a problem hiding this comment.
It seems to me that if require_label/bitmap copies the name it would be pretty inconsistent to not copy it here. On the other hand it is not possible to copy an arbitrary user pointer. One way to work this around would be to not specify the name at all, and let engine pass it as a hook argument (for any tag stored).
However, there is a bigger problem with this API design: the whole point of image constraints API extension is to validate the image & current environment compatibility externally. The image lookup can happen out of the process, e.g. on a remote server storing multiple images - with this hook API we would need to retrieve the tag for each image, send it over to this process, invoke the hook (looking for a first match, or doing that will all images, in case we are validating multiple tags?) and then forward the choice back to the server, and then get the right image... The API does not say if the hook is mutating, or idempotent. This is totally invalidating the point of the API.
I think that we need to break VM_Version::process_image_cpu_features into two parts: one that does the compatibility check (and that would be 'descriptor match'), and the other part tries to invoke prctl and fails the restore when the result is unexpected.
rvansa
left a comment
There was a problem hiding this comment.
Mostly LGTM.
In the future it would be nice to move the static stubs into a base class, so we don't need to repeat then for every platform, but let's not slow down the integration here.
I do not get all the parts but regarding the copying we were discussing it here with @TimPushkin and I find it would complicate the current code and the caller currently does not need it at all. If it is ever needed in the future one can start copying it in a fully backward compatible way. Which reminds me also that I introduced the new API call TBH I also do not understand why to currently be so strict with backward compatibility as it is all shipped in one bundle (even downstream). One can start considering backward compatibility if there is some 3rd party API implementation. |
It is a draft
src/hotspot/share/runtime/crac_engine.cppneeds to be reworked. I believecrlib_image_constraints::get_failed_bitmapshould becomeget_bitmapas this code needs to query image's CPUFeatures to find out its vector length to configure the CPU before restore. Otherwise one could also create some new user data. @rvansa?Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/crac.git pull/331/head:pull/331$ git checkout pull/331Update a local copy of the PR:
$ git checkout pull/331$ git pull https://git.openjdk.org/crac.git pull/331/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 331View PR using the GUI difftool:
$ git pr show -t 331Using diff file
Download this PR as a diff file:
https://git.openjdk.org/crac/pull/331.diff
Using Webrev
Link to Webrev Comment