RFR: 8258481: gc.g1.plab.TestPLABPromotion fails on Linux x86

Thomas Schatzl tschatzl at openjdk.java.net
Fri Dec 18 15:40:25 UTC 2020


Hi all,

  can I have reviews for this test bug fix on x86 (but it did not do the correct thing on 64 bit platforms either)?

There are sone test cases that allocates byte arrays of ~3500 bytes, and expect that almost all allocations occur in the PLABs given a PLAB waste threshold of some percentage, in this case 20%.

On x64 this is good, as the PLAB size is 4096 *words*, i.e. 32kb, and 20% of that is ~6.5kb. So all objects are allocated in PLABs as expected

On x86 the PLAB size of 4096 words is only 16kb, and 20% of that is ~3.2kb. This threshold is less than these 3500 bytes, so the test fails.

It does not fail always (but very often) because of the broken calculation for meeting the threshold: unless really *all* objects copied are of that 3500 byte size (and hence directly allocated), the current checking using integer calculation results in 0% waste, which is below the expected 20%.

The suggested fix is to lower the size of that array to 3250 bytes, which meets the criteria on both 32 and 64 bit platforms (and fix the broken calculations).

Note that we should not change this array size to much lower, because there is another test that fails otherwise.

Testing:
100 successful test runs on x86 and x64 linux each

Thanks,
  Thomas

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

Commit messages:
 - Initial commit

Changes: https://git.openjdk.java.net/jdk/pull/1842/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1842&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8258481
  Stats: 4 lines in 1 file changed: 1 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1842.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1842/head:pull/1842

PR: https://git.openjdk.java.net/jdk/pull/1842



More information about the hotspot-gc-dev mailing list