Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc9b9e22 authored by Chitti Babu Theegala's avatar Chitti Babu Theegala
Browse files

Perf: Disable KSM during new application launch

Use perlock api to disable KSM during new visible application
launch. Enable it back either when the application windows are
drawn or after 2 sec from the start of the new application.

Change-Id: I0aabab60f23fa549596aa46b436a7e464a6b1641
parent c6829793
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -786,7 +786,7 @@ public class OverScroller {

                if (mPerf != null) {
                    mIsPerfLockAcquired = true;
                    mPerf.perfLockAcquire(mDuration, mPerf.CPUS_ON_2, 0x20B, 0x30B);
                    mPerf.perfLockAcquire(mDuration, mPerf.CPUS_ON_2, 0x20B, 0x30B,0x1B00);
                }
            }

+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ LOCAL_SRC_FILES := \

LOCAL_MODULE:= services

LOCAL_JAVA_LIBRARIES := android.policy conscrypt telephony-common
LOCAL_JAVA_LIBRARIES := android.policy conscrypt telephony-common org.codeaurora.Performance

include $(BUILD_JAVA_LIBRARY)

+6 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashSet;

import org.codeaurora.Performance;
/**
 * An entry in the history stack, representing an activity.
 */
@@ -888,6 +889,11 @@ final class ActivityRecord {
        synchronized(service) {
            if (displayStartTime != 0) {
                reportLaunchTimeLocked(SystemClock.uptimeMillis());
                if(mStackSupervisor.mIsPerfLockAcquired == true)
                {
                    mStackSupervisor.mPerf.perfLockRelease();
                    mStackSupervisor.mIsPerfLockAcquired = false;
                }
            }
            startTime = 0;
            finishLaunchTickingLocked();
+14 −1
Original line number Diff line number Diff line
@@ -83,6 +83,10 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;


import org.codeaurora.Performance;


public final class ActivityStackSupervisor {
    static final boolean DEBUG = ActivityManagerService.DEBUG || false;
    static final boolean DEBUG_ADD_REMOVE = DEBUG || false;
@@ -107,7 +111,8 @@ public final class ActivityStackSupervisor {
    static final int RESUME_TOP_ACTIVITY_MSG = FIRST_SUPERVISOR_STACK_MSG + 2;
    static final int SLEEP_TIMEOUT_MSG = FIRST_SUPERVISOR_STACK_MSG + 3;
    static final int LAUNCH_TIMEOUT_MSG = FIRST_SUPERVISOR_STACK_MSG + 4;

    public Performance mPerf = null;
    public boolean mIsPerfLockAcquired = false;
    // For debugging to make sure the caller when acquiring/releasing our
    // wake lock is the system process.
    static final boolean VALIDATE_WAKE_LOCK_CALLER = false;
@@ -2102,6 +2107,14 @@ public final class ActivityStackSupervisor {
                return ar;
            }
        }
        /* Acquire perf lock during new app launch */
        if (mPerf == null) {
            mPerf = new Performance();
        }
        if (mPerf != null && mIsPerfLockAcquired == false) {
            mPerf.perfLockAcquire(2000,0x1B00);
            mIsPerfLockAcquired = true;
        }
        if (DEBUG_TASKS) Slog.d(TAG, "No task found");
        return null;
    }