Make minimum gc sleep time tunnable
Test: check smart idle maint log of StorageManagerService
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Change-Id: I5a70e4ec2ca895551b6446a9dfd4bb5003a3fbd0
diff --git a/IdleMaint.cpp b/IdleMaint.cpp
index 426be58..b1565aa 100644
--- a/IdleMaint.cpp
+++ b/IdleMaint.cpp
@@ -86,7 +86,6 @@
static const int GC_TIMEOUT_SEC = 420;
static const int DEVGC_TIMEOUT_SEC = 120;
static const int KBYTES_IN_SEGMENT = 2048;
-static const int MIN_GC_URGENT_SLEEP_TIME = 500;
static const int ONE_MINUTE_IN_MS = 60000;
static const int GC_NORMAL_MODE = 0;
static const int GC_URGENT_MID_MODE = 3;
@@ -531,7 +530,7 @@
}
void SetGCUrgentPace(int32_t neededSegments, int32_t minSegmentThreshold, float dirtyReclaimRate,
- float reclaimWeight, int32_t gcPeriod) {
+ float reclaimWeight, int32_t gcPeriod, int32_t minGCSleepTime) {
std::list<std::string> paths;
bool needGC = true;
int32_t sleepTime;
@@ -593,8 +592,8 @@
needGC = false;
} else {
sleepTime = gcPeriod * ONE_MINUTE_IN_MS / neededSegments;
- if (sleepTime < MIN_GC_URGENT_SLEEP_TIME) {
- sleepTime = MIN_GC_URGENT_SLEEP_TIME;
+ if (sleepTime < minGCSleepTime) {
+ sleepTime = minGCSleepTime;
}
}
}