RFR: 8306695: Divide by zero in G1Policy::logged_cards_processing_time [v2]

Kim Barrett kbarrett at openjdk.org
Tue Apr 25 04:25:31 UTC 2023


> Please review this change to G1Policy::logged_cards_processing_time to avoid a
> floating point division by zero when both the number of logged cards and the
> total cards processed are zero.  This happens during early GCs.  The fix is to
> change the comparison used to decide between scaling the total time vs
> ascribing all of the time to the logged cards.  It is changed from ">" to ">="
> so that it also covers the case of both values being zero.
> 
> Testing:
> mach5 tier1
> Local build with UBSAN and verified there are no longer any division by zero
> errors reported by it.

Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:

 - Merge branch 'master' into policy-div0
 - fix

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/13601/files
  - new: https://git.openjdk.org/jdk/pull/13601/files/5d00bd2f..7a6ac793

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=13601&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13601&range=00-01

  Stats: 4621 lines in 95 files changed: 3526 ins; 784 del; 311 mod
  Patch: https://git.openjdk.org/jdk/pull/13601.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13601/head:pull/13601

PR: https://git.openjdk.org/jdk/pull/13601


More information about the hotspot-gc-dev mailing list