From b549cbd39250c5b22c6e863172d18cf247022894 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Fri, 8 Jan 2021 10:52:08 +0000 Subject: [PATCH] 8258481: gc.g1.plab.TestPLABPromotion fails on Linux x86 Reviewed-by: sjohanss, kbarrett --- test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java b/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java index 0af28223e19..9b02b331782 100644 --- a/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java +++ b/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java @@ -72,7 +72,7 @@ public class TestPLABPromotion { private static final int PLAB_SIZE_HIGH = 65536; private static final int OBJECT_SIZE_SMALL = 10; private static final int OBJECT_SIZE_MEDIUM = 100; - private static final int OBJECT_SIZE_HIGH = 3500; + private static final int OBJECT_SIZE_HIGH = 3250; private static final int GC_NUM_SMALL = 1; private static final int GC_NUM_MEDIUM = 3; private static final int GC_NUM_HIGH = 7; @@ -222,7 +222,7 @@ private static void checkFields(PlabInfo info) { * @return true if checkedValue is less than MEM_DIFFERENCE_PCT percent of controlValue */ private static boolean checkRatio(long checkedValue, long controlValue) { - return (Math.abs(checkedValue) / controlValue) * 100L < MEM_DIFFERENCE_PCT; + return Math.abs(checkedValue * 100.0 / controlValue) < MEM_DIFFERENCE_PCT; } /** @@ -235,7 +235,7 @@ private static boolean checkRatio(long checkedValue, long controlValue) { * MEM_DIFFERENCE_PCT percent of controlValue */ private static boolean checkDifferenceRatio(long checkedValue, long controlValue) { - return (Math.abs(checkedValue - controlValue) / controlValue) * 100L < MEM_DIFFERENCE_PCT; + return Math.abs((checkedValue - controlValue) * 100.0 / controlValue) < MEM_DIFFERENCE_PCT; } /** @@ -304,6 +304,7 @@ public TestCase(int wastePct, public List toOptions() { return Arrays.asList("-XX:ParallelGCThreads=" + parGCThreads, "-XX:ParallelGCBufferWastePct=" + wastePct, + "-XX:ParallelGCThreads=1", // Avoid dynamic sizing of threads. "-XX:OldPLABSize=" + plabSize, "-XX:YoungPLABSize=" + plabSize, "-XX:" + (plabIsFixed ? "-" : "+") + "ResizePLAB",