guarantee RTMSpinLoopCount > 0

Doerr, Martin martin.doerr at sap.com
Tue Dec 13 10:20:51 UTC 2016


Hi Gustavo,

I think it's good to support RTMSpinLoopCount = 0.
I'd simply not generate the loop code in this case:

 if (RTMSpinLoopCount > 0) {
   li(R0, RTMSpinLoopCount);
   mtctr(R0);
 }

 if (RTMSpinLoopCount > 0) {
   bdz(retryLabel);
   ld(R0, 0, owner_addr_Reg);
   cmpdi(CCR0, R0, 0);
   bne(CCR0, SpinLoop);
 }

Generated RTM code is already very large so making it shorter sounds good :-)

Thanks and best regards,
Martin


-----Original Message-----
From: ppc-aix-port-dev [mailto:ppc-aix-port-dev-bounces at openjdk.java.net] On Behalf Of Gustavo Romero
Sent: Dienstag, 13. Dezember 2016 00:01
To: ppc-aix-port-dev at openjdk.java.net
Subject: guarantee RTMSpinLoopCount > 0

Hi!

Jtreg test hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java is failing on POWER8 due to the guarantee in

http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/88847a1b3718#l21.110

hotspot/test/compiler/rtm/locking/TestRTMSpinLoopCount.java uses
-XX:RTMSpinLoopCount=0 and so the JVM exit in one occasion through VMError::report_and_die().

x64 seems to not have that restriction since it checks for RTMSpinLoopCount less or equal to zero:

http://hg.openjdk.java.net/jdk9/hs/hotspot/file/3b4e4dbb855d/src/cpu/x86/vm/macroAssembler_x86.cpp#l1457

Could we do the same check on PPC64, i.e. in
http://hg.openjdk.java.net/jdk9/hs/hotspot/file/3b4e4dbb855d/src/cpu/ppc/vm/macroAssembler_ppc.cpp#l2585

check for a less or equal on decrement and guarantee(RTMSpinLoopCount >= 0) instead?

Thanks.

Gustavo



More information about the ppc-aix-port-dev mailing list