[master] RFR: Load Klass* without causing monitor inflation
Aleksey Shipilev
shade at openjdk.java.net
Wed Oct 20 09:39:28 UTC 2021
On Tue, 19 Oct 2021 14:44:12 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
> Until now, loading the Klass* in Lilliput may cause monitor inflation, because we needed a way to safely load the mark-word in the face of concurrent stack-locking or inflation happening. However, this caused troubles with concurrent GCs, because they may attempt to inflate monitors on from-space objects while traversing the heap for relocation/evacuation. Also, this may be a performance nuisance.
> It turns out that we don't have to fully inflate the monitor: we only need a partial inflation, up to where we install the transient INFLATING word to prevent concurrent threads from messing with the mark-word, and then read and return the mark-word safely, and swing back the original real mark word to let other threads continue.
>
> Testing:
> - [x] tier1
> - [x] tier2
> - [x] tier3
> - [ ] tier4
> - [ ] hotspot_gc
OK, I am approving this because `ObjectSynchronizer::stable_mark` is Lilliput-specific, and so changes there do not affect the upstream locking code (apart from Lilliput-specific paths).
-------------
Marked as reviewed by shade (Committer).
PR: https://git.openjdk.java.net/lilliput/pull/25
More information about the lilliput-dev
mailing list