Merge "Make sure gc_urgent is normal mode, when no need GC" am: 2534f6c8cf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2280527 Change-Id: I28464dc425e416f0790e5e6b0e3cc099aedb05fd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -2821,6 +2821,8 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS);
|
enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
int avgWriteAmount = 0;
|
||||||
|
int targetDirtyRatio = mTargetDirtyRatio;
|
||||||
int latestWrite = mVold.getWriteAmount();
|
int latestWrite = mVold.getWriteAmount();
|
||||||
if (latestWrite == -1) {
|
if (latestWrite == -1) {
|
||||||
Slog.w(TAG, "Failed to get storage write record");
|
Slog.w(TAG, "Failed to get storage write record");
|
||||||
@@ -2833,11 +2835,12 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
// (first boot after OTA), We skip the smart idle maintenance
|
// (first boot after OTA), We skip the smart idle maintenance
|
||||||
if (!needsCheckpoint() || !supportsBlockCheckpoint()) {
|
if (!needsCheckpoint() || !supportsBlockCheckpoint()) {
|
||||||
if (!refreshLifetimeConstraint() || !checkChargeStatus()) {
|
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: " +
|
Slog.i(TAG, "Set smart idle maintenance: " + "latest write amount: " +
|
||||||
latestWrite + ", average write amount: " + avgWriteAmount +
|
latestWrite + ", average write amount: " + avgWriteAmount +
|
||||||
", min segment threshold: " + mMinSegmentsThreshold +
|
", min segment threshold: " + mMinSegmentsThreshold +
|
||||||
@@ -2845,10 +2848,10 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
", segment reclaim weight: " + mSegmentReclaimWeight +
|
", segment reclaim weight: " + mSegmentReclaimWeight +
|
||||||
", period(min): " + sSmartIdleMaintPeriod +
|
", period(min): " + sSmartIdleMaintPeriod +
|
||||||
", min gc sleep time(ms): " + mMinGCSleepTime +
|
", min gc sleep time(ms): " + mMinGCSleepTime +
|
||||||
", target dirty ratio: " + mTargetDirtyRatio);
|
", target dirty ratio: " + targetDirtyRatio);
|
||||||
mVold.setGCUrgentPace(avgWriteAmount, mMinSegmentsThreshold, mDirtyReclaimRate,
|
mVold.setGCUrgentPace(avgWriteAmount, mMinSegmentsThreshold, mDirtyReclaimRate,
|
||||||
mSegmentReclaimWeight, sSmartIdleMaintPeriod,
|
mSegmentReclaimWeight, sSmartIdleMaintPeriod,
|
||||||
mMinGCSleepTime, mTargetDirtyRatio);
|
mMinGCSleepTime, targetDirtyRatio);
|
||||||
} else {
|
} else {
|
||||||
Slog.i(TAG, "Skipping smart idle maintenance - block based checkpoint in progress");
|
Slog.i(TAG, "Skipping smart idle maintenance - block based checkpoint in progress");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user