8304341: [Lilliput] Use fixed-size lock-stack #81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Until now, we used to have a variable-sized lock-stack: when pushing an object to it and capacity is exceeded, it would re-allocate a new stack and use that. However, experiments show that the lock-stack very rarely exceeds 5 slots (I have not yet found a workload that does actually exceed it). It makes sense to make the lock-stack a fixed-size array: it makes addressing the lock-stack simpler and more efficient and it increases the likelyhood of the lock-stack being in CPU cache. If the lock-stack is ever exceeded, we would not do stack-locking at all, but instead inflate the monitor and use that.
This is already integrated in the related upstream PR: openjdk/jdk#10907
Testing:
Progress
Integration blocker
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/lilliput.git pull/81/head:pull/81
$ git checkout pull/81
Update a local copy of the PR:
$ git checkout pull/81
$ git pull https://git.openjdk.org/lilliput.git pull/81/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 81
View PR using the GUI difftool:
$ git pr show -t 81
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/lilliput/pull/81.diff
Webrev
Link to Webrev Comment