[crac] RFR: 8373784: [CRaC] VM Option to require perfect CPU fit

Radim Vansa rvansa at openjdk.org
Wed Jan 7 15:35:32 UTC 2026


On Tue, 6 Jan 2026 20:35:02 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:

>> Right now CRaC will refuse to restore from the image if it is not compatible with current CPU as it assumes extra features. This check can be only relaxed with -XX:+UnlockExperimentalVMOptions -XX:+IgnoreCPUFeatures.
>> 
>> In scenarios with -XX:CRaCIgnoreRestoreIfUnavailable it might be favorable to skip the restore and proceed with running the application from scratch with all CPU features if the image has these restricted. Therefore I propose to create a new option -XX:CheckCPUFeatures with these values:
>> * compatible - this is the current behaviour (default)
>> * exact - require CPU features from the image to match perfectly
>> * skip - the same behaviour as `-XX:+IgnoreCPUFeatures`.
>> 
>> The current `-XX:+IgnoreCPUFeatures` option will be deprecated.
>
> src/hotspot/share/runtime/crac.cpp line 824:
> 
>> 822:       return;
>> 823:     }
>> 824:     ignore = true;
> 
> This has only local effect, `VM_Version::ignore_cpu_features()` would still return `false`. But that is a part of the `-XX:CPUFeatures=ignore` vs. `-XX:+IgnoreCPUFeatures` unification so it may be OK here.

Not sure what you're suggesting. If `-XX:CPUFeatures=ignore` is set on checkpoint the function will always return `true`, because the features are not stored anyway, so the `CheckCPUFeatures` is practically ignored. Are you saying that we should emit some warning in here?

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

PR Review Comment: https://git.openjdk.org/crac/pull/285#discussion_r2668931948


More information about the crac-dev mailing list