[crac] RFR: 8355974: [CRaC] Move CPUFeatures verification to the parent process of JVM [v5]
Jan Kratochvil
jkratochvil at openjdk.org
Wed Apr 30 15:23:46 UTC 2025
On Wed, 30 Apr 2025 13:58:29 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:
>> 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
Changed in 03ea8d2648c5465ab053d05c71e0a5c3dc7c7ba6 .
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/227#discussion_r2068903982
More information about the crac-dev
mailing list