[lkml]   [2021]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectCLOCK_MONOTONIC after suspend

I have a comment/question related to this admittedly quite old commit:


It states "(...) As reported by several folks systemd and other
applications rely on the documented behaviour of CLOCK_MONOTONIC on
Linux and break with the above changes. After resume daemons time out
and other timeout related issues are observed. Rafael compiled this
list: (...)".

From user space perspective similar issues can still be observed. I
guess these ostensible time jumps happen because user space is frozen
before the kernel fell asleep and vice versa on suspend:

dT = (T_KS_asleep – T_US_asleep) + (T_US_awake – T_KS_awake) // T: point
in time, KS: kernel space, US: user space

With a simple user space program that prints out the monotonic time each
100ms along with the day time, I did some measurements on my notebook.
It reveals the following discrepancies (time gaps) between the last time
stamp written before suspend and the first time stamp after resume:

dT in [s] #1 #2 #3 #4 #5 #6 #7

Suspend2RAM 6.409 6.423 7.451 3.444 7.815 5.655 7.178

Suspend2Disk 5.228 2.683 5.072 5.198 4.806 5.763 6.908

Is this effect known and accepted or is there some way to prevent or
mitigate it?



 \ /
  Last update: 2021-12-15 18:32    [W:0.041 / U:2.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site