Skip to content
Permalink
Browse files
8258481: gc.g1.plab.TestPLABPromotion fails on Linux x86
Reviewed-by: sjohanss, kbarrett
  • Loading branch information
Thomas Schatzl committed Jan 8, 2021
1 parent fc1d2a1 commit b549cbd39250c5b22c6e863172d18cf247022894
Showing 1 changed file with 4 additions and 3 deletions.
@@ -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<String> 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",

1 comment on commit b549cbd

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on b549cbd Jan 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.