Skip to content

Commit 3eb1d05

Browse files
Vladimir Kozlovrkennke
andcommitted
8328986: Deprecate UseRTM* flags for removal
Co-authored-by: Roman Kennke <[email protected]> Reviewed-by: vlivanov, sviswanathan, dholmes
1 parent 0cb0b5d commit 3eb1d05

File tree

4 files changed

+96
-81
lines changed

4 files changed

+96
-81
lines changed

src/hotspot/cpu/x86/globals_x86.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,18 @@ define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
154154
\
155155
/* Use Restricted Transactional Memory for lock eliding */ \
156156
product(bool, UseRTMLocking, false, \
157-
"Enable RTM lock eliding for inflated locks in compiled code") \
157+
"(Deprecated) Enable RTM lock eliding for inflated locks " \
158+
"in compiled code") \
158159
\
159160
product(bool, UseRTMForStackLocks, false, EXPERIMENTAL, \
160161
"Enable RTM lock eliding for stack locks in compiled code") \
161162
\
162163
product(bool, UseRTMDeopt, false, \
163-
"Perform deopt and recompilation based on RTM abort ratio") \
164+
"(Deprecated) Perform deopt and recompilation based on " \
165+
"RTM abort ratio") \
164166
\
165167
product(int, RTMRetryCount, 5, \
166-
"Number of RTM retries on lock abort or busy") \
168+
"(Deprecated) Number of RTM retries on lock abort or busy") \
167169
range(0, max_jint) \
168170
\
169171
product(int, RTMSpinLoopCount, 100, EXPERIMENTAL, \

src/hotspot/share/runtime/arguments.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,11 @@ static SpecialFlag const special_jvm_flags[] = {
501501
{ "RequireSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() },
502502
{ "UseSharedSpaces", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() },
503503
{ "RegisterFinalizersAtInit", JDK_Version::jdk(22), JDK_Version::jdk(23), JDK_Version::jdk(24) },
504-
504+
#if defined(X86)
505+
{ "UseRTMLocking", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
506+
{ "UseRTMDeopt", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
507+
{ "RTMRetryCount", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
508+
#endif // X86
505509
// --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in:
506510
{ "CreateMinidumpOnCrash", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() },
507511

src/java.base/share/man/java.1

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,24 +2477,6 @@ This option has a limit of 2 GB; otherwise, an error is generated.
24772477
The maximum code cache size shouldn\[aq]t be less than the initial code
24782478
cache size; see the option \f[V]-XX:InitialCodeCacheSize\f[R].
24792479
.TP
2480-
\f[V]-XX:RTMAbortRatio=\f[R]\f[I]abort_ratio\f[R]
2481-
Specifies the RTM abort ratio is specified as a percentage (%) of all
2482-
executed RTM transactions.
2483-
If a number of aborted transactions becomes greater than this ratio,
2484-
then the compiled code is deoptimized.
2485-
This ratio is used when the \f[V]-XX:+UseRTMDeopt\f[R] option is
2486-
enabled.
2487-
The default value of this option is 50.
2488-
This means that the compiled code is deoptimized if 50% of all
2489-
transactions are aborted.
2490-
.TP
2491-
\f[V]-XX:RTMRetryCount=\f[R]\f[I]number_of_retries\f[R]
2492-
Specifies the number of times that the RTM locking code is retried, when
2493-
it is aborted or busy, before falling back to the normal locking
2494-
mechanism.
2495-
The default value for this option is 5.
2496-
The \f[V]-XX:UseRTMLocking\f[R] option must be enabled.
2497-
.TP
24982480
\f[V]-XX:+SegmentedCodeCache\f[R]
24992481
Enables segmentation of the code cache, without which the code cache
25002482
consists of one large segment.
@@ -2728,65 +2710,6 @@ FMA intrinsics are generated for the
27282710
value of \f[V](\f[R] \f[I]a\f[R] \f[V]*\f[R] \f[I]b\f[R] \f[V]+\f[R]
27292711
\f[I]c\f[R] \f[V])\f[R] expressions.
27302712
.TP
2731-
\f[V]-XX:+UseRTMDeopt\f[R]
2732-
Autotunes RTM locking depending on the abort ratio.
2733-
This ratio is specified by the \f[V]-XX:RTMAbortRatio\f[R] option.
2734-
If the number of aborted transactions exceeds the abort ratio, then the
2735-
method containing the lock is deoptimized and recompiled with all locks
2736-
as normal locks.
2737-
This option is disabled by default.
2738-
The \f[V]-XX:+UseRTMLocking\f[R] option must be enabled.
2739-
.TP
2740-
\f[V]-XX:+UseRTMLocking\f[R]
2741-
Generates Restricted Transactional Memory (RTM) locking code for all
2742-
inflated locks, with the normal locking mechanism as the fallback
2743-
handler.
2744-
This option is disabled by default.
2745-
Options related to RTM are available only on x86 CPUs that support
2746-
Transactional Synchronization Extensions (TSX).
2747-
.RS
2748-
.PP
2749-
RTM is part of Intel\[aq]s TSX, which is an x86 instruction set
2750-
extension and facilitates the creation of multithreaded applications.
2751-
RTM introduces the new instructions \f[V]XBEGIN\f[R], \f[V]XABORT\f[R],
2752-
\f[V]XEND\f[R], and \f[V]XTEST\f[R].
2753-
The \f[V]XBEGIN\f[R] and \f[V]XEND\f[R] instructions enclose a set of
2754-
instructions to run as a transaction.
2755-
If no conflict is found when running the transaction, then the memory
2756-
and register modifications are committed together at the \f[V]XEND\f[R]
2757-
instruction.
2758-
The \f[V]XABORT\f[R] instruction can be used to explicitly abort a
2759-
transaction and the \f[V]XTEST\f[R] instruction checks if a set of
2760-
instructions is being run in a transaction.
2761-
.PP
2762-
A lock on a transaction is inflated when another thread tries to access
2763-
the same transaction, thereby blocking the thread that didn\[aq]t
2764-
originally request access to the transaction.
2765-
RTM requires that a fallback set of operations be specified in case a
2766-
transaction aborts or fails.
2767-
An RTM lock is a lock that has been delegated to the TSX\[aq]s system.
2768-
.PP
2769-
RTM improves performance for highly contended locks with low conflict in
2770-
a critical region (which is code that must not be accessed by more than
2771-
one thread concurrently).
2772-
RTM also improves the performance of coarse-grain locking, which
2773-
typically doesn\[aq]t perform well in multithreaded applications.
2774-
(Coarse-grain locking is the strategy of holding locks for long periods
2775-
to minimize the overhead of taking and releasing locks, while
2776-
fine-grained locking is the strategy of trying to achieve maximum
2777-
parallelism by locking only when necessary and unlocking as soon as
2778-
possible.)
2779-
Also, for lightly contended locks that are used by different threads,
2780-
RTM can reduce false cache line sharing, also known as cache line
2781-
ping-pong.
2782-
This occurs when multiple threads from different processors are
2783-
accessing different resources, but the resources share the same cache
2784-
line.
2785-
As a result, the processors repeatedly invalidate the cache lines of
2786-
other processors, which forces them to read from main memory instead of
2787-
their cache.
2788-
.RE
2789-
.TP
27902713
\f[V]-XX:+UseSuperWord\f[R]
27912714
Enables the transformation of scalar operations into superword
27922715
operations.
@@ -3825,6 +3748,83 @@ The default value is 2.
38253748
.PP
38263749
Use the option \f[V]-XX:MinRAMPercentage\f[R] instead.
38273750
.RE
3751+
.TP
3752+
\f[V]-XX:RTMAbortRatio=\f[R]\f[I]abort_ratio\f[R]
3753+
Specifies the RTM abort ratio is specified as a percentage (%) of all
3754+
executed RTM transactions.
3755+
If a number of aborted transactions becomes greater than this ratio,
3756+
then the compiled code is deoptimized.
3757+
This ratio is used when the \f[V]-XX:+UseRTMDeopt\f[R] option is
3758+
enabled.
3759+
The default value of this option is 50.
3760+
This means that the compiled code is deoptimized if 50% of all
3761+
transactions are aborted.
3762+
.TP
3763+
\f[V]-XX:RTMRetryCount=\f[R]\f[I]number_of_retries\f[R]
3764+
Specifies the number of times that the RTM locking code is retried, when
3765+
it is aborted or busy, before falling back to the normal locking
3766+
mechanism.
3767+
The default value for this option is 5.
3768+
The \f[V]-XX:UseRTMLocking\f[R] option must be enabled.
3769+
.TP
3770+
\f[V]-XX:+UseRTMDeopt\f[R]
3771+
Autotunes RTM locking depending on the abort ratio.
3772+
This ratio is specified by the \f[V]-XX:RTMAbortRatio\f[R] option.
3773+
If the number of aborted transactions exceeds the abort ratio, then the
3774+
method containing the lock is deoptimized and recompiled with all locks
3775+
as normal locks.
3776+
This option is disabled by default.
3777+
The \f[V]-XX:+UseRTMLocking\f[R] option must be enabled.
3778+
.TP
3779+
\f[V]-XX:+UseRTMLocking\f[R]
3780+
Generates Restricted Transactional Memory (RTM) locking code for all
3781+
inflated locks, with the normal locking mechanism as the fallback
3782+
handler.
3783+
This option is disabled by default.
3784+
Options related to RTM are available only on x86 CPUs that support
3785+
Transactional Synchronization Extensions (TSX).
3786+
.RS
3787+
.PP
3788+
RTM is part of Intel\[aq]s TSX, which is an x86 instruction set
3789+
extension and facilitates the creation of multithreaded applications.
3790+
RTM introduces the new instructions \f[V]XBEGIN\f[R], \f[V]XABORT\f[R],
3791+
\f[V]XEND\f[R], and \f[V]XTEST\f[R].
3792+
The \f[V]XBEGIN\f[R] and \f[V]XEND\f[R] instructions enclose a set of
3793+
instructions to run as a transaction.
3794+
If no conflict is found when running the transaction, then the memory
3795+
and register modifications are committed together at the \f[V]XEND\f[R]
3796+
instruction.
3797+
The \f[V]XABORT\f[R] instruction can be used to explicitly abort a
3798+
transaction and the \f[V]XTEST\f[R] instruction checks if a set of
3799+
instructions is being run in a transaction.
3800+
.PP
3801+
A lock on a transaction is inflated when another thread tries to access
3802+
the same transaction, thereby blocking the thread that didn\[aq]t
3803+
originally request access to the transaction.
3804+
RTM requires that a fallback set of operations be specified in case a
3805+
transaction aborts or fails.
3806+
An RTM lock is a lock that has been delegated to the TSX\[aq]s system.
3807+
.PP
3808+
RTM improves performance for highly contended locks with low conflict in
3809+
a critical region (which is code that must not be accessed by more than
3810+
one thread concurrently).
3811+
RTM also improves the performance of coarse-grain locking, which
3812+
typically doesn\[aq]t perform well in multithreaded applications.
3813+
(Coarse-grain locking is the strategy of holding locks for long periods
3814+
to minimize the overhead of taking and releasing locks, while
3815+
fine-grained locking is the strategy of trying to achieve maximum
3816+
parallelism by locking only when necessary and unlocking as soon as
3817+
possible.)
3818+
Also, for lightly contended locks that are used by different threads,
3819+
RTM can reduce false cache line sharing, also known as cache line
3820+
ping-pong.
3821+
This occurs when multiple threads from different processors are
3822+
accessing different resources, but the resources share the same cache
3823+
line.
3824+
As a result, the processors repeatedly invalidate the cache lines of
3825+
other processors, which forces them to read from main memory instead of
3826+
their cache.
3827+
.RE
38283828
.SH OBSOLETE JAVA OPTIONS
38293829
.PP
38303830
These \f[V]java\f[R] options are still accepted but ignored, and a

test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ public class VMDeprecatedOptions {
6262
{"CreateMinidumpOnCrash", "false"}
6363
}
6464
));
65+
if (Platform.isX86() || Platform.isX64()) {
66+
deprecated.addAll(
67+
Arrays.asList(new String[][] {
68+
{"UseRTMLocking", "false"},
69+
{"UseRTMDeopt", "false"},
70+
{"RTMRetryCount", "5"}
71+
})
72+
);
73+
}
6574
if (wb.isJFRIncluded()) {
6675
deprecated.add(new String[] {"FlightRecorder", "false"});
6776
}

0 commit comments

Comments
 (0)