Skip to content

Commit dce7a57

Browse files
committedDec 22, 2023
8321683: Tests fail with AssertionError in RangeWithPageSize
Reviewed-by: stuefe, mbaesken
1 parent c53f845 commit dce7a57

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed
 

‎test/hotspot/jtreg/runtime/os/TestTracePageSizes.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public RangeWithPageSize(String start, String end, String pageSize, String thpEl
350350
this.start = Long.parseUnsignedLong(start, 16);
351351
this.end = Long.parseUnsignedLong(end, 16);
352352
this.pageSize = Long.parseLong(pageSize);
353-
this.thpEligible = Integer.parseInt(thpEligible) == 1;
353+
this.thpEligible = thpEligible == null ? false : (Integer.parseInt(thpEligible) == 1);
354354

355355
vmFlagHG = false;
356356
vmFlagHT = false;
@@ -365,12 +365,11 @@ public RangeWithPageSize(String start, String end, String pageSize, String thpEl
365365
}
366366
}
367367

368-
// When the THP policy is 'always' instead of 'madvise, the vmFlagHG property is false.
369-
// Check the THPeligible property instead.
370-
isTHP = !vmFlagHT && this.thpEligible;
368+
// When the THP policy is 'always' instead of 'madvise, the vmFlagHG property is false,
369+
// therefore also check thpEligible. If this is still causing problems in the future,
370+
// we might have to check the AnonHugePages field.
371371

372-
// vmFlagHG should imply isTHP
373-
assert !vmFlagHG || isTHP;
372+
isTHP = vmFlagHG || this.thpEligible;
374373
}
375374

376375
public long getPageSize() {

0 commit comments

Comments
 (0)
Please sign in to comment.