Merge "Make target dirty segment ratio tunable" am: a303ea139d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2132302 Change-Id: I860bf4a5e7951faa5b78ed7737a80afb9a6e1474 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -362,6 +362,8 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
private static final boolean DEFAULT_CHARGING_REQUIRED = true;
|
private static final boolean DEFAULT_CHARGING_REQUIRED = true;
|
||||||
// Minimum GC interval sleep time in ms
|
// Minimum GC interval sleep time in ms
|
||||||
private static final int DEFAULT_MIN_GC_SLEEPTIME = 10000;
|
private static final int DEFAULT_MIN_GC_SLEEPTIME = 10000;
|
||||||
|
// Target dirty segment ratio to aim to
|
||||||
|
private static final int DEFAULT_TARGET_DIRTY_RATIO = 80;
|
||||||
|
|
||||||
private volatile int mLifetimePercentThreshold;
|
private volatile int mLifetimePercentThreshold;
|
||||||
private volatile int mMinSegmentsThreshold;
|
private volatile int mMinSegmentsThreshold;
|
||||||
@@ -370,6 +372,7 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
private volatile float mLowBatteryLevel;
|
private volatile float mLowBatteryLevel;
|
||||||
private volatile boolean mChargingRequired;
|
private volatile boolean mChargingRequired;
|
||||||
private volatile int mMinGCSleepTime;
|
private volatile int mMinGCSleepTime;
|
||||||
|
private volatile int mTargetDirtyRatio;
|
||||||
private volatile boolean mNeedGC;
|
private volatile boolean mNeedGC;
|
||||||
|
|
||||||
private volatile boolean mPassedLifetimeThresh;
|
private volatile boolean mPassedLifetimeThresh;
|
||||||
@@ -2680,6 +2683,8 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
"charging_required", DEFAULT_CHARGING_REQUIRED);
|
"charging_required", DEFAULT_CHARGING_REQUIRED);
|
||||||
mMinGCSleepTime = DeviceConfig.getInt(DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT,
|
mMinGCSleepTime = DeviceConfig.getInt(DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT,
|
||||||
"min_gc_sleeptime", DEFAULT_MIN_GC_SLEEPTIME);
|
"min_gc_sleeptime", DEFAULT_MIN_GC_SLEEPTIME);
|
||||||
|
mTargetDirtyRatio = DeviceConfig.getInt(DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT,
|
||||||
|
"target_dirty_ratio", DEFAULT_TARGET_DIRTY_RATIO);
|
||||||
|
|
||||||
// If we use the smart idle maintenance, we need to turn off GC in the traditional idle
|
// If we use the smart idle maintenance, we need to turn off GC in the traditional idle
|
||||||
// maintenance to avoid the conflict
|
// maintenance to avoid the conflict
|
||||||
@@ -2820,10 +2825,11 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
", dirty reclaim rate: " + mDirtyReclaimRate +
|
", dirty reclaim rate: " + mDirtyReclaimRate +
|
||||||
", 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);
|
||||||
mVold.setGCUrgentPace(avgWriteAmount, mMinSegmentsThreshold, mDirtyReclaimRate,
|
mVold.setGCUrgentPace(avgWriteAmount, mMinSegmentsThreshold, mDirtyReclaimRate,
|
||||||
mSegmentReclaimWeight, sSmartIdleMaintPeriod,
|
mSegmentReclaimWeight, sSmartIdleMaintPeriod,
|
||||||
mMinGCSleepTime);
|
mMinGCSleepTime, mTargetDirtyRatio);
|
||||||
} 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