-
Notifications
You must be signed in to change notification settings - Fork 5.8k
JDK-8304820: Statically allocate ObjectSynchronizer mutexes #13160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Justin King <jcking@google.com>
👋 Welcome back jcking! A progress list of the required criteria for merging this PR into |
Webrevs
|
Thumbs up. |
@jcking This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 67 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/reviewers 2 |
Signed-off-by: Justin King <jcking@google.com>
Hm. We may want to try placing each mutex on separate cache lines if necessary. Can be done by creating a lightweight wrapper struct which uses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine.
Thanks.
Looking into the macOS odd build errors before moving forward. |
Signed-off-by: Justin King <jcking@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still thumbs up.
Yeah, sorry had to fix how the storage was declared. Forgot that the compiler inserts the default constructor if you use a typed array. Should be good now, waiting on GHA to confirm. |
// Static storage for an array of PlatformMutex. Each entry is aligned to `alignas(PlatformMutex)` | ||
// by property of the storage itself being aligned to that requirement and each entry storage being | ||
// `sizeof(PlatformMutex)` aligned up to `alignof(PlatformMutex)`. | ||
alignas(PlatformMutex) static uint8_t _inflation_locks[inflation_lock_count()][align_up(sizeof(PlatformMutex), alignof(PlatformMutex))]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid you lost me here. Why does this have to be so convoluted/obscure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought sizeof(T)
always was a multiple of alignof(T)
. Is there some case where this is not true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I had assumed it wasn't required. But a quick glance says it is. So I'll remove the align_up
. Should be more simple now.
Signed-off-by: Justin King <jcking@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still good.
Last call for complaints/concerns/etc. I'll wait until roughly 24 hours from now. |
/integrate |
Going to push as commit fe42312.
Your commit was automatically rebased without conflicts. |
Similar to https://git.openjdk.org/jdk/pull/13143, statically allocate mutexes which live for the lifetime of the process.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13160/head:pull/13160
$ git checkout pull/13160
Update a local copy of the PR:
$ git checkout pull/13160
$ git pull https://git.openjdk.org/jdk.git pull/13160/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 13160
View PR using the GUI difftool:
$ git pr show -t 13160
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13160.diff