Skip to content

Commit

Permalink
PM / sleep: Measure the time of filesystems syncing
Browse files Browse the repository at this point in the history
Measure the filesystems sync time during system sleep more precisely.

Among other things, this allows the pr_cont() to be dropped from
ksys_sync_helper() and makes automatic system suspend and hibernation
profiling somewhat more straightforward.

Signed-off-by: Harry Pan <harry.pan@intel.com>
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Harry Pan authored and Rafael J. Wysocki committed Apr 2, 2019
1 parent b5dee31 commit c64546b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ EXPORT_SYMBOL_GPL(unlock_system_sleep);

void ksys_sync_helper(void)
{
pr_info("Syncing filesystems ... ");
ktime_t start;
long elapsed_msecs;

start = ktime_get();
ksys_sync();
pr_cont("done.\n");
elapsed_msecs = ktime_to_ms(ktime_sub(ktime_get(), start));
pr_info("Filesystems sync: %ld.%03ld seconds\n",
elapsed_msecs / MSEC_PER_SEC, elapsed_msecs % MSEC_PER_SEC);
}
EXPORT_SYMBOL_GPL(ksys_sync_helper);

Expand Down

0 comments on commit c64546b

Please sign in to comment.