RFR: JDK-8283674: Pad ObjectMonitor allocation size to cache line size

Daniel D.Daugherty dcubed at openjdk.java.net
Mon Mar 28 18:40:43 UTC 2022


On Fri, 25 Mar 2022 09:02:28 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> See discussion under [1].
> 
> Since the libc malloc allocator may place ObjectMonitor instances adjacent to each other, we should pad the size of ObjectMonitor to fill a whole cache line to prevent false sharing between adjacent OMs.
> 
> [1] https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2022-March/054187.html

Short answer:

When we did the work on https://bugs.openjdk.java.net/browse/JDK-8253064,
there was a lot of performance testing done at that time and none of that testing
pointed to a problem with removing the padding at the end of the ObjectMonitor.

If this PR is going to move forward, then there needs to be performance testing
to show that it is needed. I have not done any testing related to this fix.

@fisk and I worked on the code for JDK-8253064 together and @ericcaspole did
the performance testing. @fisk may have done additional performance testing on
his own since he has access to other hardware in his locale.

I'll be adding a longer answer, but that requires research and that will take a while.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7955


More information about the hotspot-runtime-dev mailing list