RFR: 8253262: Allocate in DumpRegion is not thread safe
David Holmes
dholmes at openjdk.java.net
Tue Sep 22 02:05:25 UTC 2020
On Mon, 21 Sep 2020 16:22:40 GMT, Yumin Qi <minqi at openjdk.org> wrote:
>> It seems to me that the need for locking should be an internal implementation detail of
>> MetaspaceShared::symbol_space_alloc, rather than Symbol operator new.
>
>> It seems to me that the need for locking should be an internal implementation detail of
>> MetaspaceShared::symbol_space_alloc, rather than Symbol operator new.
>
> I pushed before saw your above comment. The reason for current place is because the following code:
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/oops/symbol.cpp#L75
> DEBUG_ONLY(static void* last = 0);
> void* p = (void*)MetaspaceShared::symbol_space_alloc(size(len)*wordSize);
> assert(p > last, "must increase monotonically");
> DEBUG_ONLY(last = p);
> return p;
> this 'last' is not thread safe either.
My comment was made after the integration so no issue there.
But I think the monotonicity check also belongs inside MetaspaceShared::symbol_space_alloc
-------------
PR: https://git.openjdk.java.net/jdk/pull/216
More information about the hotspot-dev
mailing list