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

Commit bc34045c authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Make sure gc_urgent is normal mode, when no need GC" am: 2534f6c8 am:...

Merge "Make sure gc_urgent is normal mode, when no need GC" am: 2534f6c8 am: a513296a am: fcb55837

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2280527



Change-Id: I4b1254ee9051f1079f72a3182e86b13b9e57a40f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4ce57312 fcb55837
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -2753,6 +2753,8 @@ class StorageManagerService extends IStorageManager.Stub
        enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS);

        try {
            int avgWriteAmount = 0;
            int targetDirtyRatio = mTargetDirtyRatio;
            int latestWrite = mVold.getWriteAmount();
            if (latestWrite == -1) {
                Slog.w(TAG, "Failed to get storage write record");
@@ -2765,11 +2767,12 @@ class StorageManagerService extends IStorageManager.Stub
            // (first boot after OTA), We skip the smart idle maintenance
            if (!needsCheckpoint() || !supportsBlockCheckpoint()) {
                if (!refreshLifetimeConstraint() || !checkChargeStatus()) {
                    return;
                    Slog.i(TAG, "Turn off gc_urgent based on checking lifetime and charge status");
                    targetDirtyRatio = 100;
                } else {
                    avgWriteAmount = getAverageWriteAmount();
                }

                int avgWriteAmount = getAverageWriteAmount();

                Slog.i(TAG, "Set smart idle maintenance: " + "latest write amount: " +
                            latestWrite + ", average write amount: " + avgWriteAmount +
                            ", min segment threshold: " + mMinSegmentsThreshold +
@@ -2777,10 +2780,10 @@ class StorageManagerService extends IStorageManager.Stub
                            ", segment reclaim weight: " + mSegmentReclaimWeight +
                            ", period(min): " + sSmartIdleMaintPeriod +
                            ", min gc sleep time(ms): " + mMinGCSleepTime +
                            ", target dirty ratio: " + mTargetDirtyRatio);
                            ", target dirty ratio: " + targetDirtyRatio);
                mVold.setGCUrgentPace(avgWriteAmount, mMinSegmentsThreshold, mDirtyReclaimRate,
                                      mSegmentReclaimWeight, sSmartIdleMaintPeriod,
                                      mMinGCSleepTime, mTargetDirtyRatio);
                                      mMinGCSleepTime, targetDirtyRatio);
            } else {
                Slog.i(TAG, "Skipping smart idle maintenance - block based checkpoint in progress");
            }