Commit 5fd8238e authored by Yi Lin's avatar Yi Lin

running a simple exp on this version

parent 1f99093b
......@@ -29,10 +29,13 @@ public class Config {
public static final int USE_PAGE_PROTECTION_WRITE_YP = 2;
public static final int USE_CODE_PATCHING_YP = 3;
public static final int USE_NO_YP = 9;
public final boolean ENABLE_YP_STAT;
Config(BuildTimeConfig config) {
ACTIVE_PLAN = config.getPlanName();
HEADER_MARK_BITS = config.getBooleanProperty("mmtk.headerMarkBit",true);
if (config.getBooleanProperty("mmtk.use_checking_yp", false)) {
YIELDPOINT_IMPL = USE_CHECKING_YP;
} else if (config.getBooleanProperty("mmtk.use_page_protection_read_yp", false)) {
......@@ -46,6 +49,8 @@ public class Config {
} else {
YIELDPOINT_IMPL = USE_CHECKING_YP;
}
ENABLE_YP_STAT = config.getBooleanProperty("mmtk.enable_yp_stat", false);
}
public void printConfig() {
......
......@@ -3787,17 +3787,16 @@ public final class RVMThread extends ThreadContext {
@NoCheckStore
@Unpreemptible
public static void blockAllMutatorsForGC() {
if (YieldpointStatistics.ENABLED) {
YieldpointStatistics.gcRequestBlockTime = Magic.getTimeBase();
}
// request block - timestamp
YieldpointStatistics.gcRequestBlockTime = Magic.getTimeBase();
turnOnYieldpoints();
if (YieldpointStatistics.ENABLED) {
long turnOnLatency = (Magic.getTimeBase() - YieldpointStatistics.gcRequestBlockTime);
if (turnOnLatency < 0)
turnOnLatency = 0;
YieldpointStatistics.yieldpointTurnedOnLatency += turnOnLatency;
}
// yieldpoints turned on - timestamp
long turnOnLatency = (Magic.getTimeBase() - YieldpointStatistics.gcRequestBlockTime);
if (turnOnLatency < 0)
turnOnLatency = 0;
YieldpointStatistics.yieldpointTurnedOnLatency += turnOnLatency;
RVMThread.handshakeLock.lockNoHandshake();
while (true) {
......@@ -3846,9 +3845,8 @@ public final class RVMThread extends ThreadContext {
// Deal with terminating threads to ensure that all threads are either dead to MMTk or stopped above.
RVMThread.processAboutToTerminate();
if (YieldpointStatistics.ENABLED) {
YieldpointStatistics.allThreadBlockedLatency += (Magic.getTimeBase() - YieldpointStatistics.gcRequestBlockTime);
}
// all thread blocked - time stamp
YieldpointStatistics.allThreadBlockedLatency += (Magic.getTimeBase() - YieldpointStatistics.gcRequestBlockTime);
turnOffYieldpoints();
}
......@@ -5627,7 +5625,7 @@ public final class RVMThread extends ThreadContext {
public static final Extent PROTECT_PAGE_SIZE = Extent.fromIntSignExtend(SizeConstants.BYTES_IN_PAGE);
public static void turnOnYieldpoints() {
VM.sysWriteln("Turn on yieldpoints");
// VM.sysWriteln("Turn on yieldpoints");
if (org.mmtk.vm.VM.config.YIELDPOINT_IMPL == org.mmtk.vm.Config.USE_PAGE_PROTECTION_READ_YP ||
org.mmtk.vm.VM.config.YIELDPOINT_IMPL == org.mmtk.vm.Config.USE_PAGE_PROTECTION_WRITE_YP) {
Memory.mprotect(PROTECT_GLOBAL_PAGE_BL, PROTECT_PAGE_SIZE, Memory.PROT_NONE);
......@@ -5637,7 +5635,7 @@ public final class RVMThread extends ThreadContext {
}
public static void turnOffYieldpoints() {
VM.sysWriteln("Turn off yieldpoints");
// VM.sysWriteln("Turn off yieldpoints");
if (org.mmtk.vm.VM.config.YIELDPOINT_IMPL == org.mmtk.vm.Config.USE_PAGE_PROTECTION_READ_YP ||
org.mmtk.vm.VM.config.YIELDPOINT_IMPL == org.mmtk.vm.Config.USE_PAGE_PROTECTION_WRITE_YP) {
Memory.mprotect(PROTECT_GLOBAL_PAGE_BL, PROTECT_PAGE_SIZE, Memory.PROT_EXEC | Memory.PROT_READ | Memory.PROT_WRITE);
......
......@@ -8,15 +8,13 @@ import org.vmmagic.pragma.Uninterruptible;
@Uninterruptible
public class YieldpointStatistics {
public static final boolean ENABLED = true;
// how many yieldpoints taken in total
public static SynchronizedCounter yieldpointTaken = new SynchronizedCounter();
public static long gcRequestBlockTime;
public static long yieldpointTurnedOnLatency;
public static long allThreadBlockedLatency;
public static long yieldpointTurnedOnLatency = 0;
public static long allThreadBlockedLatency = 0;
public static void reset() {
yieldpointTaken.reset();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment