summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Daeho Jeong <daehojeong@google.com> 2022-06-23 16:12:52 -0700
committer Daeho Jeong <daehojeong@google.com> 2022-06-24 13:20:36 -0700
commit6fa155f8edbf3198bc0e4c56ef9c1d86cce013c4 (patch)
tree88deedac3070a31262988583fac8ca54cfa2a461
parenta31a605797a9ebb1ae95571eaaf1c99b0a7799bf (diff)
Make minimum gc sleep time tunnable
Test: check smart idle maint log of StorageManagerService Signed-off-by: Daeho Jeong <daehojeong@google.com> Change-Id: I004bb6752e84d26b041cfdd27848949f6e49d05e
-rw-r--r--services/core/java/com/android/server/StorageManagerService.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
index 3b2cd80abdf7..98b754f44cea 100644
--- a/services/core/java/com/android/server/StorageManagerService.java
+++ b/services/core/java/com/android/server/StorageManagerService.java
@@ -354,6 +354,8 @@ class StorageManagerService extends IStorageManager.Stub
private static final float DEFAULT_LOW_BATTERY_LEVEL = 20F;
// Decide whether charging is required to turn on the feature
private static final boolean DEFAULT_CHARGING_REQUIRED = true;
+ // Minimum GC interval sleep time in ms
+ private static final int DEFAULT_MIN_GC_SLEEPTIME = 10000;
private volatile int mLifetimePercentThreshold;
private volatile int mMinSegmentsThreshold;
@@ -361,6 +363,7 @@ class StorageManagerService extends IStorageManager.Stub
private volatile float mSegmentReclaimWeight;
private volatile float mLowBatteryLevel;
private volatile boolean mChargingRequired;
+ private volatile int mMinGCSleepTime;
private volatile boolean mNeedGC;
private volatile boolean mPassedLifetimeThresh;
@@ -2611,6 +2614,8 @@ class StorageManagerService extends IStorageManager.Stub
"low_battery_level", DEFAULT_LOW_BATTERY_LEVEL);
mChargingRequired = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT,
"charging_required", DEFAULT_CHARGING_REQUIRED);
+ mMinGCSleepTime = DeviceConfig.getInt(DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT,
+ "min_gc_sleeptime", DEFAULT_MIN_GC_SLEEPTIME);
// If we use the smart idle maintenance, we need to turn off GC in the traditional idle
// maintenance to avoid the conflict
@@ -2750,9 +2755,11 @@ class StorageManagerService extends IStorageManager.Stub
", min segment threshold: " + mMinSegmentsThreshold +
", dirty reclaim rate: " + mDirtyReclaimRate +
", segment reclaim weight: " + mSegmentReclaimWeight +
- ", period: " + sSmartIdleMaintPeriod);
+ ", period(min): " + sSmartIdleMaintPeriod +
+ ", min gc sleep time(ms): " + mMinGCSleepTime);
mVold.setGCUrgentPace(avgWriteAmount, mMinSegmentsThreshold, mDirtyReclaimRate,
- mSegmentReclaimWeight, sSmartIdleMaintPeriod);
+ mSegmentReclaimWeight, sSmartIdleMaintPeriod,
+ mMinGCSleepTime);
} else {
Slog.i(TAG, "Skipping smart idle maintenance - block based checkpoint in progress");
}