RFR: 8251158: Implementation of JEP 387: Elastic Metaspace [v11]

Thomas Stuefe stuefe at openjdk.java.net
Tue Oct 6 11:09:45 UTC 2020


On Mon, 5 Oct 2020 19:20:02 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

>> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review Feedback Richard 1
>
> src/hotspot/share/memory/metaspace/counters.hpp line 108:
> 
>> 106:     assert(old >= 1,
>> 107:         "underflow (" UINT64_FORMAT "-1)", (uint64_t)old);
>> 108: #endif
> 
> The assertion is incorrect because it is not atomic wrt the actual update. I commented on this before. It should be
> fairly easy to write a multi-thread gtest that produces false positives of the assertion (if it is easy to write a
> multi-threaded gtest). The person affected by a false positive crash will be not too amused. I suggest to fix or remove
> the assertion.

Okay, I feel stupid now but I do not see it.

I see the non-atomicity, but not how it could cause a false positive assert here. I see that I could miss an assert,
but not the other way around.

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

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



More information about the hotspot-gc-dev mailing list