[master] RFR: Load Klass* without causing monitor inflation
Roman Kennke
rkennke at openjdk.java.net
Tue Oct 19 16:55:30 UTC 2021
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
- [ ] tier3
- [ ] tier4
- [ ] hotspot_gc
-------------
Commit messages:
- Load Klass* without causing monitor inflation
Changes: https://git.openjdk.java.net/lilliput/pull/25/files
Webrev: https://webrevs.openjdk.java.net/?repo=lilliput&pr=25&range=00
Stats: 77 lines in 2 files changed: 75 ins; 1 del; 1 mod
Patch: https://git.openjdk.java.net/lilliput/pull/25.diff
Fetch: git fetch https://git.openjdk.java.net/lilliput pull/25/head:pull/25
PR: https://git.openjdk.java.net/lilliput/pull/25
More information about the lilliput-dev
mailing list