RFR: 8335334: Stress mode to randomly execute unstable if traps [v4]
Christian Hagedorn
chagedorn at openjdk.org
Mon Sep 23 09:10:41 UTC 2024
On Thu, 19 Sep 2024 12:48:53 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> Unstable if traps are supposed to be taken rarely. This patch introduces a `StressUnstableIfTraps` flag that forces unstable if traps to be taken randomly and thus potentially triggering intermittent bugs such as incorrect debug information. It works by adding another if before the unstable if that checks a "random" condition at runtime (a simple shared counter) and then either takes the trap or executes the original, unstable if.
>>
>> This stress option also has the nice side effect of triggering re-compilation of methods that would otherwise not be re-compiled (see [JDK-8335843](https://bugs.openjdk.org/browse/JDK-8335843)).
>>
>> I had to adjust a few tests that rely on methods being compiled / deoptimized because with the stress option enabled, deoptimization might unexpectedly (not) happen.
>>
>> It reliably triggers [JDK-8335977](https://bugs.openjdk.org/browse/JDK-8335977), [JDK-8320308](https://bugs.openjdk.org/browse/JDK-8320308) and [JDK-8335843](https://bugs.openjdk.org/browse/JDK-8335843) in our testing.
>>
>> Tested with multiple runs up to tier6. I'll integrate it into our (Oracle internal) testing and CTW [(JDK-8340302)](https://bugs.openjdk.org/browse/JDK-8340302) once all the bugs that it currently triggers are fixed.
>>
>> Thanks,
>> Tobias
>
> Tobias Hartmann has updated the pull request incrementally with one additional commit since the last revision:
>
> More reviewer comments
Small suggestion, otherwise, it looks good to me, too!
src/hotspot/share/opto/parse2.cpp line 1587:
> 1585: }
> 1586:
> 1587: void Parse::stress_trap(IfNode* orig_iff, Node* counter, Node* incr_store) {
Can you add a brief summary as method comment (i.e. following the explanation in the PR)? This would help to understand the reason why we want to stress traps, how it looks in the IR, and how frequently the trap is taken.
-------------
Marked as reviewed by chagedorn (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/21037#pullrequestreview-2321188322
PR Review Comment: https://git.openjdk.org/jdk/pull/21037#discussion_r1770809178
More information about the hotspot-dev
mailing list