Integrated: 8270894: Use acquire semantics in ObjectSynchronizer::read_stable_mark()
Roman Kennke
rkennke at openjdk.java.net
Fri Jul 23 10:45:03 UTC 2021
On Mon, 19 Jul 2021 19:13:59 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
> Currently, the object header is read using plain loads in read_stable_mark() (synchronizer.cpp). The matching stores use release semantics in corresponding CAS and release_store(). It seems reasonable to use acquire-semantics for the loads of the object header.
>
> See also discussion here:
> https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2021-July/050132.html
>
> I propose to use MO_ACQUIRE when reading the object header in read_stable_mark() and some related loads of the header. As discussed in the thread, current_thread_holds_lock() is the only place where we could do without acquire, but it doesn't seem worth to introduce extra complexity just to make this access relaxed, because it does not seem to be used in any place that looks very performance sensitive.
>
> If it were me, I'd probably also change the other mark() calls to MO_ACQUIRE for consistency, but that might be overkill.
>
> Testing:
> - [x] tier1
> - [x] tier2
This pull request has now been integrated.
Changeset: f2261903
Author: Roman Kennke <rkennke at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/f22619032df2cf45664f110c71ddf509a5128900
Stats: 11 lines in 3 files changed: 6 ins; 0 del; 5 mod
8270894: Use acquire semantics in ObjectSynchronizer::read_stable_mark()
Reviewed-by: dholmes
-------------
PR: https://git.openjdk.java.net/jdk/pull/4829
More information about the hotspot-runtime-dev
mailing list