-
Bug
-
Resolution: Duplicate
-
P3
-
23
-
b08
-
aarch64
While working on a JMH I noticed that with JDK-8324186, with -XX:-AlwaysMergeDMB I could get a sequence of multiple dmb combos. A simple example JMH is pasted at the bottom. This multiple dmb's does not happen with +AlwaysMergeDMB.
I am not sure if this causes a regression in any established benchmark.
========
From perfasm:
0.06% 0x0000ffff9488c874: str w12, [x20, #12] ;*invokespecial <init> {reexecute=0 rethrow=0 return_oop=0}
; - org.openjdk.bench.vm.compiler.DoubleDMB$A::<init>@16 (line 30)
; - org.openjdk.bench.vm.compiler.DoubleDMB$C::getA@16 (line 39)
; - org.openjdk.bench.vm.compiler.DoubleDMB::action@14 (line 56)
0x0000ffff9488c878: dmb ishst
0.01% 0x0000ffff9488c87c: dmb ishld
1.28% 0x0000ffff9488c880: dmb ishst
0.02% 0x0000ffff9488c884: dmb ishld ;*putstatic c {reexecute=0 rethrow=0 return_oop=0}
; - org.openjdk.bench.vm.compiler.DoubleDMB::action@8 (line 54)
0x0000ffff9488c888: ldrsb w10, [x28, #56]
0.04% 0x0000ffff9488c88c: cbnz w10, 0x0000ffff9488c990
1.10% 0x0000ffff9488c890: mov x10, x21
=====
package org.openjdk.bench.vm.compiler;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.CompilerControl;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Group;
import org.openjdk.jmh.annotations.GroupThreads;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OperationsPerInvocation;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
@BenchmarkMode(Mode.Throughput)
@State(Scope.Benchmark)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Warmup(iterations = 8, time = 4)
@Measurement(iterations = 6, time = 3)
public class DoubleDMB {
class A {
final String b = new String("Hi there");
}
class C {
private A a;
public A getA() {
if (a == null) {
a = new A();
}
return a;
}
}
static C c = null;
@Setup
public void setup() {
c = new C();
}
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
void action(Blackhole b) throws Exception {
c = new C();
if (c.getA().b == null) {
throw new Exception("a should not be null");
}
b.consume(c);
}
@Benchmark
@Fork(value = 1, jvmArgsAppend = {
"-XX:+UnlockDiagnosticVMOptions", "-XX:+AlwaysMergeDMB"})
public void plusAlwaysMergeDMB(Blackhole b) throws Exception {
action(b);
}
@Benchmark
@Fork(value = 1, jvmArgsAppend = {
"-XX:+UnlockDiagnosticVMOptions", "-XX:-AlwaysMergeDMB"})
public void minusAlwaysMergeDMB(Blackhole b) throws Exception {
action(b);
}
}
I am not sure if this causes a regression in any established benchmark.
========
From perfasm:
0.06% 0x0000ffff9488c874: str w12, [x20, #12] ;*invokespecial <init> {reexecute=0 rethrow=0 return_oop=0}
; - org.openjdk.bench.vm.compiler.DoubleDMB$A::<init>@16 (line 30)
; - org.openjdk.bench.vm.compiler.DoubleDMB$C::getA@16 (line 39)
; - org.openjdk.bench.vm.compiler.DoubleDMB::action@14 (line 56)
0x0000ffff9488c878: dmb ishst
0.01% 0x0000ffff9488c87c: dmb ishld
1.28% 0x0000ffff9488c880: dmb ishst
0.02% 0x0000ffff9488c884: dmb ishld ;*putstatic c {reexecute=0 rethrow=0 return_oop=0}
; - org.openjdk.bench.vm.compiler.DoubleDMB::action@8 (line 54)
0x0000ffff9488c888: ldrsb w10, [x28, #56]
0.04% 0x0000ffff9488c88c: cbnz w10, 0x0000ffff9488c990
1.10% 0x0000ffff9488c890: mov x10, x21
=====
package org.openjdk.bench.vm.compiler;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.CompilerControl;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Group;
import org.openjdk.jmh.annotations.GroupThreads;
import org.openjdk.jmh.annotations.Measurement;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OperationsPerInvocation;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
@BenchmarkMode(Mode.Throughput)
@State(Scope.Benchmark)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Warmup(iterations = 8, time = 4)
@Measurement(iterations = 6, time = 3)
public class DoubleDMB {
class A {
final String b = new String("Hi there");
}
class C {
private A a;
public A getA() {
if (a == null) {
a = new A();
}
return a;
}
}
static C c = null;
@Setup
public void setup() {
c = new C();
}
@CompilerControl(CompilerControl.Mode.DONT_INLINE)
void action(Blackhole b) throws Exception {
c = new C();
if (c.getA().b == null) {
throw new Exception("a should not be null");
}
b.consume(c);
}
@Benchmark
@Fork(value = 1, jvmArgsAppend = {
"-XX:+UnlockDiagnosticVMOptions", "-XX:+AlwaysMergeDMB"})
public void plusAlwaysMergeDMB(Blackhole b) throws Exception {
action(b);
}
@Benchmark
@Fork(value = 1, jvmArgsAppend = {
"-XX:+UnlockDiagnosticVMOptions", "-XX:-AlwaysMergeDMB"})
public void minusAlwaysMergeDMB(Blackhole b) throws Exception {
action(b);
}
}
- duplicates
-
JDK-8325449 [BACKOUT] use "dmb.ishst+dmb.ishld" for release barrier
- Resolved
- relates to
-
JDK-8324186 use "dmb.ishst+dmb.ishld" for release barrier
- Closed