Integrated: 8344414: ZGC: Another division by zero in rule_major_allocation_rate
Axel Boldt-Christmas
aboldtch at openjdk.org
Tue Dec 3 10:45:46 UTC 2024
On Tue, 19 Nov 2024 07:18:20 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
> This specific issue was known since #20888. As well as a more serious issue in `calculate_extra_young_gc_time` which may introduce a `NaN`. This specific issue is sane as long as we have IEEE 754 sans the C++ standard making division by zero UB.
>
> As discussed in #21304 it is probably better to try and tackle the division by zero issue by making sure the input is never zero. This patch introduces a small offset to the average which will effectively leave the value unchanged unless it is zero, and behave as almost zero in calculations without causing actual division by zero.
>
> There is still the issue with `NaN`, this patch adds a short circuit when this can occur and returns the analytical result of the calculation.
This pull request has now been integrated.
Changeset: 63af2f42
Author: Axel Boldt-Christmas <aboldtch at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/63af2f42b7abe9504897d7c3f3b4cc0b57123694
Stats: 28 lines in 3 files changed: 11 ins; 1 del; 16 mod
8344414: ZGC: Another division by zero in rule_major_allocation_rate
Reviewed-by: eosterlund, stefank
-------------
PR: https://git.openjdk.org/jdk/pull/22228
More information about the hotspot-gc-dev
mailing list