RFR: 8329088: Stack chunk thawing races with concurrent GC stack iteration [v2]

Erik Österlund eosterlund at openjdk.org
Fri Apr 5 16:57:10 UTC 2024


On Fri, 5 Apr 2024 12:15:01 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> src/hotspot/share/oops/oop.inline.hpp line 242:
>> 
>>> 240: inline void oopDesc::int_field_put(int offset, jint value)          { *field_addr<jint>(offset) = value;    }
>>> 241: inline jint oopDesc::int_field_relaxed(int offset) const            { return Atomic::load(field_addr<jint>(offset)); }
>>> 242: inline void oopDesc::int_field_put_relaxed(int offset, jint value)  { Atomic::store(field_addr<jint>(offset), value); }
>> 
>> I have a stylistic question/suggestion. These are basically Java heap accessors, shouldn't they go through `HeapAccess<MO_RELAXED>::{load,store}`? This would also match the style already used in this file.
>
> We don't use HeapAccess to access primitive values in objects. HeapAccess is only used when we access oops.
> 
> We do use RawAccess in some of these functions though, but we do that because there's no support for MQ_SEQ_CST in the Atomic APIs.

Ideally the SEQ_CST support would live in Atomic where it arguably belongs. Then we could remove all primitive support from the Access API and have a clear distinction that it's an oop thing.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18643#discussion_r1554000301


More information about the hotspot-dev mailing list