summaryrefslogtreecommitdiff
path: root/libperfmgr/NodeLooperThread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libperfmgr/NodeLooperThread.cc')
-rw-r--r--libperfmgr/NodeLooperThread.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/libperfmgr/NodeLooperThread.cc b/libperfmgr/NodeLooperThread.cc
index e7a63cc5..b4a27a96 100644
--- a/libperfmgr/NodeLooperThread.cc
+++ b/libperfmgr/NodeLooperThread.cc
@@ -98,9 +98,15 @@ void NodeLooperThread::DumpToFd(int fd) {
bool NodeLooperThread::threadLoop() {
::android::AutoMutex _l(lock_);
std::chrono::milliseconds timeout_ms = kMaxUpdatePeriod;
+
+ // Update 2 passes: some node may have dependency in other node
+ // e.g. update cpufreq min to VAL while cpufreq max still set to
+ // a value lower than VAL, is expected to fail in first pass
+ for (auto& n : nodes_) {
+ n->Update(false);
+ }
for (auto& n : nodes_) {
- auto t = n->Update();
- timeout_ms = std::min(t, timeout_ms);
+ timeout_ms = std::min(n->Update(), timeout_ms);
}
nsecs_t sleep_timeout_ns = std::numeric_limits<nsecs_t>::max();