Merge "init: add timers around sync() during shutdown"
This commit is contained in:
commit
39273df651
1 changed files with 12 additions and 2 deletions
|
|
@ -429,10 +429,20 @@ void RebootThread(unsigned int cmd, std::chrono::milliseconds shutdown_timeout,
|
||||||
if (kill_after_apps.count(s->name())) s->Stop();
|
if (kill_after_apps.count(s->name())) s->Stop();
|
||||||
}
|
}
|
||||||
// 4. sync, try umount, and optionally run fsck for user shutdown
|
// 4. sync, try umount, and optionally run fsck for user shutdown
|
||||||
sync();
|
{
|
||||||
|
Timer sync_timer;
|
||||||
|
LOG(INFO) << "sync() before umount...";
|
||||||
|
sync();
|
||||||
|
LOG(INFO) << "sync() before umount took" << sync_timer;
|
||||||
|
}
|
||||||
UmountStat stat = TryUmountAndFsck(runFsck, shutdown_timeout - t.duration());
|
UmountStat stat = TryUmountAndFsck(runFsck, shutdown_timeout - t.duration());
|
||||||
// Follow what linux shutdown is doing: one more sync with little bit delay
|
// Follow what linux shutdown is doing: one more sync with little bit delay
|
||||||
sync();
|
{
|
||||||
|
Timer sync_timer;
|
||||||
|
LOG(INFO) << "sync() after umount...";
|
||||||
|
sync();
|
||||||
|
LOG(INFO) << "sync() after umount took" << sync_timer;
|
||||||
|
}
|
||||||
if (cmd != ANDROID_RB_THERMOFF) std::this_thread::sleep_for(100ms);
|
if (cmd != ANDROID_RB_THERMOFF) std::this_thread::sleep_for(100ms);
|
||||||
LogShutdownTime(stat, &t);
|
LogShutdownTime(stat, &t);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue