RFR: 8267579: Thread::cooked_allocated_bytes() hits assert(left >= right) failed: avoid underflow [v2]

Markus Grönlund mgronlun at openjdk.java.net
Tue Jun 8 09:38:13 UTC 2021


On Mon, 7 Jun 2021 20:19:10 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> Markus Grönlund has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   read once
>
> Thumbs up.
> 
> Should the `_start` and `_top` fields be marked `volatile` to
> prevent the S390 compiler from "optimizing" like it did with
> another recent bug (JDK-8267842)?

@dcubed-ojdk Thanks Dan for looking at this. Hmm...having to introduce an explicit "volatile" keyword implies the "read-once" promise of Atomic::load() is not sufficient? I was told the side-effects of via Atomic::load(), which makes expressions volatile-qualified, are sufficient for read-once. But maybe not for all platforms?

If "volatile" decorations are required, I would prefer, granted it's sufficient, to only decorate the local variables. Having to decorate the tlab pointers could result in introducing unnecessary ordering constraints, i.e. for the TLAB owner, which could perhaps hurt performance?

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

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


More information about the hotspot-jfr-dev mailing list