[crac] RFR: 8355974: [CRaC] Move CPUFeatures verification to the parent process of JVM [v5]
Timofei Pushkin
tpushkin at openjdk.org
Wed Apr 30 14:01:59 UTC 2025
On Wed, 30 Apr 2025 13:53:09 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:
>> Jan Kratochvil has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Refactor the usage of prepare_user_data_api()
>
> src/hotspot/share/runtime/crac_engine.cpp line 473:
>
>> 471: datap = nullptr;
>> 472: }
>> 473: if (!VM_Version::cpu_features_binary_check(datap)) {
>
> From the architectural point of view, I don't like that the checking is performed inside `CracEngine` because the class represents the engine API (originally it just encapsulated handles for lib, APIs, conf to have RAII). When calling `crac_engine.cpufeatures_check()` it's like we are asking the engine to check the features but this is not what the engine itself is doing.
>
> I would suggest:
> - `CracEngine::cpufeatures_store` receives a pre-filled `VM_Version::CPUFeaturesBinary` and just stores it.
> - `CracEngine::cpufeatures_load` loads `VM_Version::CPUFeaturesBinary`, validates the size and not-null-ness and returns a copy of it (copying is to be able to destroy the user data).
>
> This is just a suggestion, feel free to not implement this if you don't like it.
And sorry for asking to reimplement the same stuff the third time, I should've suggested that all together
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/227#discussion_r2068727411
More information about the crac-dev
mailing list