RFR: 8317422: [JVMCI] concurrency issue in MethodData creation

Tom Rodriguez never at openjdk.org
Wed Oct 4 08:54:06 UTC 2023


On Tue, 3 Oct 2023 10:28:10 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

> `Method::build_profiling_method_data` is the safe way to create `MethodData` for a `Method` - it uses an atomic to do the write.
> This PR updates `c2v_getFailedSpeculationAddress` and `c2v_reprofile` to use `Method::build_profiling_method_data`.

It's possible my diagnosis of this is wrong since `set_method_data` tries to handle the memory ordering by doing a `release_store` but maybe that's not strong enough?  I see there is also `release_store_fence`.  Anyway, I think this cleanup is a good idea even if it's not the full fix.

I think we should eliminate the public `set_method_data` completely.  `set_method_data(null)` should be a new `clear_method_data()` and we'd need to fix ciReplay.cpp to also call `build_profiling_method_data`.

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

PR Comment: https://git.openjdk.org/jdk/pull/16026#issuecomment-1745473146


More information about the hotspot-compiler-dev mailing list