RFR: 8330157: C2: Add a stress flag for bailouts [v6]

Emanuel Peter epeter at openjdk.org
Mon Jul 1 07:07:38 UTC 2024


On Mon, 1 Jul 2024 06:39:19 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Daniel Skantz has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - tweak probability in CtwRunner, add CaptureBailoutInformation
>>  - remove once-used method arg
>
> src/hotspot/share/opto/compile.hpp line 859:
> 
>> 857: #ifdef ASSERT
>> 858:   bool fail_randomly() {
>> 859:     if (!_stress_seed_is_initialized || (random() % StressBailoutProbability)) {
> 
> Suggestion:
> 
>     if (!_stress_seed_is_initialized || (random() % StressBailoutProbability) != 0) {
> 
> I think the new style is to never let values (ints, pointers, etc, only booleans are ok) be considered as conditions directly. So you would need a comparison.

Also: you could mention somewhere that this is the `Geometric distribution`, with `p = 1 / StressBailoutProbability`, and the mean to the bailout is `1 / p = StressBailoutProbability`. In that sense the naming of `StressBailoutProbability` is not entirely accurate. It should either be `StressBailoutMean`, or `StressBailoutReciprocalProbablility`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19646#discussion_r1660554360


More information about the hotspot-compiler-dev mailing list