RFR: 8330051: Small ObjectMonitor spinning code cleanups [v4]
Erik Österlund
eosterlund at openjdk.org
Thu Apr 18 14:02:04 UTC 2024
On Wed, 17 Apr 2024 13:56:13 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Please review this patch that refactors some functions in the adaptive spinning code and moves the Knobs to where they're used and can be modified for experiments in the following code. Also changed 'goto's to a 'break'. I didn't change the names of TrySpin or TryLock, since all the names in this file are this style.
>>
>> The only non-cosmetic change is for the pre-spin. If the TryLock returns that a CAS failed, then the pre-spin ends, which shouldn't make a difference wrt to performance because the pre-spin is only for 10 iterations, but somehow my numbers are a little bit better for both Dacapo pmd and xalan.
>>
>> Tested with tier1-7.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>
> Make TryLockResult an enum class for better grepping and C++ type checking.
This looks good to me. Maybe one name change nit. I don't need to see the updated version.
src/hotspot/share/runtime/objectMonitor.hpp line 358:
> 356:
> 357:
> 358: enum class TryLockResult { CasFailed = -1, HasOwner = 0, Success = 1};
Maybe "Failed" instead of "CasFailed" for consistency, since we don't call the success "CasSuccess".
-------------
Marked as reviewed by eosterlund (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/18730#pullrequestreview-2008736057
PR Review Comment: https://git.openjdk.org/jdk/pull/18730#discussion_r1570620363
More information about the hotspot-runtime-dev
mailing list