mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: George Anzinger <george@mvista.com>
To: john stultz <johnstul@us.ibm.com>
Cc: Pavel Machek <pavel@suse.cz>, Patrick Mochel <mochel@osdl.org>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [pm] fix time after suspend-to-*
Date: Thu, 23 Oct 2003 19:10:19 -0700	[thread overview]
Message-ID: <3F988A0B.4010803@mvista.com> (raw)
In-Reply-To: <1066955396.1122.133.camel@cog.beaverton.ibm.com>

john stultz wrote:
> On Thu, 2003-10-23 at 16:09, George Anzinger wrote:
> 
>>john stultz wrote:
>>
>>>On Thu, 2003-10-23 at 13:23, George Anzinger wrote:
>>>
>>>>I lost (never saw) the first of this thread, BUT, if this is 2.6, I strongly 
>>>>recommend that settimeofday() NOT be called.  It will try to adjust 
>>>>wall_to_motonoic, but, as this appears to be a correction for time lost while 
>>>>sleeping, wall_to_monotonic should not change.
>>>
>>>While suspended should the notion monotonic time be incrementing? If
>>>we're not incrementing jiffies, then uptime isn't being incremented, so
>>>to me it doesn't follow that the monotonic time should be incrementing
>>>as well. 
>>
>>Uh, not moving jiffies?  What does this say about any timers that may be 
>>pending?  Say for cron or some such?  Like I said, I picked up this thread a bit 
>>late, but, seems to me that if time is passing, it should pass on both the 
>>jiffies AND the wall clocks.
> 
> 
> My understanding is that we are suspending the box (ie: putting your
> laptop to sleep/hybernate), so for all practical purposes the box is off
> waiting until it is woken up. During that time I don't believe we
> receive timer interrupts. When we are woken up, we should update the
> system time and continue, but as the box wasn't running during the
> interim we shouldn't be increasing the notion of monotonic time. 
> 
> 
>>>It may very well be a POSIX timers spec issue, but it just strikes me as
>>>odd.
>>
>>The spec thing would relate to any sleeps or timers that are pending.  The spec 
>>would seem to say they should complete somewhere near the requested wall time, 
>>but NEVER before.  By not moving jiffies, I think they will be a bit late.  Now, 
>>if they were to complete during the sleep, well those should fire at completion 
>>of the sleep.  If the are to complete after the sleep, then, it seems to me, 
>>they should fire at the requested time.
> 
> 
> Hmmm. That last sentence gives me pause. I guess it comes down to how
> you request your timer expiration: in wall time or system time.  I
> always thought it was in system time, but you know this stuff better
> then I, so I'll defer.

The request can be on the wall clock or on clock_monotonic.  Still, we went 
round and round about how a tick on one should be a tick on the other.  My 
understanding is that the pm_timer was put in the ACPIC to handle this, but then 
I don't know how far down power is going, nor for how long.  I would think at 
some point the discontinuity would be large enough that one would want some user 
service to run and "fix" all the broken time assumptions.  Some sort of a soft 
reboot that would kick the ntp code, cron and so on, much as is done at boot.


-- 
George Anzinger   george@mvista.com
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml

ps, long week end, out till Tuesday...


  parent reply	other threads:[~2003-10-24  2:10 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-22 23:33 Pavel Machek
2003-10-22 23:52 ` john stultz
2003-10-23  8:17   ` Pavel Machek
2003-10-23 20:23     ` George Anzinger
2003-10-23 20:55       ` john stultz
2003-10-23 23:09         ` George Anzinger
2003-10-23 23:38           ` Pavel Machek
2003-10-24  0:29           ` john stultz
2003-10-24  0:39             ` john stultz
2003-10-24  2:10             ` George Anzinger [this message]
2003-10-24  7:48               ` Pavel Machek
2003-10-27 23:24                 ` George Anzinger
2003-10-27 23:43                   ` Patrick Mochel
2003-10-28  1:35                     ` Nigel Cunningham
2003-10-28  8:33                     ` Felipe Alfaro Solana
2003-10-28  9:32                       ` Pavel Machek
2003-10-28 11:41                         ` Stephen Rothwell
2003-10-28 12:29                           ` Pavel Machek
2003-10-28 12:39                             ` Stephen Rothwell
2003-10-28 22:23                           ` Peter Chubb
2003-10-29  2:24                             ` Valdis.Kletnieks
2003-10-29  9:43                             ` Pavel Machek
2003-10-28 14:30                         ` Felipe Alfaro Solana
2003-10-28 17:28                           ` Pavel Machek
2003-10-28 20:16                             ` Felipe Alfaro Solana
2003-10-28 21:13                               ` Andreas Schwab
2003-10-28 21:29                               ` George Anzinger
2003-10-29  9:38                               ` Pavel Machek
2003-10-29 11:28                                 ` Gabriel Paubert
2003-10-29 11:55                                   ` PCI Bus error 6290 or 0290 Remus
2003-10-29 12:40                                     ` Meelis Roos
2003-10-29 12:49                                       ` Remus
2003-10-29 20:42                                 ` [pm] fix time after suspend-to-* George Anzinger
2003-10-30  9:02                                   ` Pavel Machek
2003-10-28 15:21                         ` Valdis.Kletnieks
2003-10-28 17:26                           ` Pavel Machek
2003-10-28 18:20                       ` Patrick Mochel
2003-10-28 19:36                         ` Valdis.Kletnieks
2003-10-28 20:19                         ` Felipe Alfaro Solana
2003-10-24  7:49             ` Pavel Machek
2003-10-23 23:40       ` Pavel Machek
2003-10-27 22:43         ` Patrick Mochel
2003-10-22 23:57 ` Måns Rullgård
2003-10-29  8:20 Mathias Fröhlich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F988A0B.4010803@mvista.com \
    --to=george@mvista.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=pavel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome