RFR: 8149085: IntegrationTest1.java fails intermittently due to use of semi-initialized TLAB
stefan.johansson at oracle.com
Wed Jun 8 14:22:32 UTC 2016
On 2016-06-08 15:57, Mikael Gerdin wrote:
> On 2016-06-08 13:56, Erik Helin wrote:
>> On 2016-05-24, Stefan Johansson wrote:
>>> Please review this fix for:
>> Looks reasonable, it is better than the current check. Reviewed.
Thanks guys for being reasonable :)
>>> Thread::cooked_allocated_bytes() tries to give a good estimation of
>>> how much
>>> has been allocated by a given thread. It does this by adding the stored
>>> _allocated_bytes valued, incremented when a TLAB is retired, with
>>> the used
>>> bytes from the currently active TLAB. This works fine when
>>> cooked_allocated_bytes() is called by the current thread, but when
>>> called to
>>> query a different thread there is a risk that the thread is in the
>>> middle of
>>> retiring its TLAB. In such case there was risk that a bad
>>> used_bytes() value
>>> was used and in turn caused the test in question to fail.
>>> A similar issue seems to have been semi-fixed before, the removed code
>>> suggests that making sure that the signed used bytes size is more
>>> than zero
>>> is enough to make it a valid TLAB, but it turns out this is not enough.
>>> Instead making sure that the used bytes value is less than the max
>>> TLAB-size should ensure that the TLAB has been fully initialized.
>>> As the added comment suggests there is still a race present in this
>>> and I don't intend to fix this now because I see this more as a fast
>>> sampling function than something that we should rely on.
>>> Verified fix locally. RBT run for G1 and Parallel is ongoing.
More information about the hotspot-gc-dev