Re: TSC not updating after resume: Bug or Feature?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Thursday, December 18, 2008 - 2:24 am

On Wed, 2008-12-17 at 12:50 -0500, Steven Rostedt wrote:

Thanks Steve..


Right, so cpu_clock() relies on gtod and tsc to generate a timestamp. We
use a tick_raw (tsc) and tick_gtod, we then use tick_raw to compute a
delta in tsc and add that to tick_gtod and clip the stuff to a jiffy
window and filter backward motion.

On resume I imagine the TSC has a totally unrelated value to the TSC
before suspend, this would mean the clock would quickly end up either at
whatever place the backward motion filter saw last (new TSC < old TSC)
or at the jiffy window clip (new TSC > old TSC).

Time will only start running correctly again once the jiffy tick starts.

Then there is the acpi idle code and NOHZ stuff, that call the
sched_clock_tick() by hand in order to re-sync time (because an unknown
quantity of time passed and gtod has all the machinery of figuring that
out).

So yes, this is expected behaviour,.. OTOH I really didn't think much
about code relying on this timesource _that_ early and such.

Rafael, would something like this explain why we had to revert Shaggy's
patch? His patch fixes the backward motion filter and I'm at an utter
loss why that would break suspend.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
TSC not updating after resume: Bug or Feature?, Deepak Saxena, (Wed Dec 17, 10:27 am)
Re: TSC not updating after resume: Bug or Feature?, Steven Rostedt, (Wed Dec 17, 10:50 am)
Re: TSC not updating after resume: Bug or Feature?, Peter Zijlstra, (Thu Dec 18, 2:24 am)
Re: TSC not updating after resume: Bug or Feature?, Ingo Molnar, (Thu Dec 18, 5:39 am)
Re: TSC not updating after resume: Bug or Feature?, Rafael J. Wysocki, (Thu Dec 18, 3:19 pm)
Re: TSC not updating after resume: Bug or Feature?, Dave Kleikamp, (Thu Dec 18, 3:25 pm)
Re: TSC not updating after resume: Bug or Feature?, Rafael J. Wysocki, (Thu Dec 18, 4:39 pm)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Sun Dec 21, 9:26 am)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Sun Dec 21, 12:43 pm)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Sun Dec 21, 1:54 pm)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Sun Dec 21, 2:19 pm)
Re: TSC not updating after resume: Bug or Feature?, Fabio Comolli, (Sun Dec 21, 3:43 pm)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Mon Dec 22, 7:48 am)
Re: TSC not updating after resume: Bug or Feature?, Ingo Molnar, (Mon Dec 22, 8:00 am)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Mon Dec 22, 11:47 am)
Re: TSC not updating after resume: Bug or Feature?, Fabio Comolli, (Mon Dec 22, 1:19 pm)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Mon Dec 22, 1:36 pm)
Re: TSC not updating after resume: Bug or Feature?, Fabio Comolli, (Mon Dec 22, 1:39 pm)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Mon Dec 22, 2:13 pm)
Re: TSC not updating after resume: Bug or Feature?, Fabio Comolli, (Mon Dec 22, 2:35 pm)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Mon Dec 22, 3:05 pm)
Re: TSC not updating after resume: Bug or Feature?, Fabio Comolli, (Mon Dec 22, 3:12 pm)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Mon Dec 22, 3:16 pm)
Re: TSC not updating after resume: Bug or Feature?, Fabio Comolli, (Mon Dec 22, 3:29 pm)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Mon Dec 22, 3:33 pm)
Re: TSC not updating after resume: Bug or Feature?, Rafael J. Wysocki, (Mon Dec 22, 5:28 pm)
Re: TSC not updating after resume: Bug or Feature?, Rafael J. Wysocki, (Mon Dec 22, 5:47 pm)
Re: TSC not updating after resume: Bug or Feature?, Thomas Gleixner, (Tue Dec 23, 12:03 am)
Re: TSC not updating after resume: Bug or Feature?, Rafael J. Wysocki, (Tue Dec 23, 7:15 am)
Re: TSC not updating after resume: Bug or Feature?, Fabio Comolli, (Tue Dec 23, 12:42 pm)
Re: TSC not updating after resume: Bug or Feature?, Deepak Saxena, (Tue Dec 23, 3:03 pm)
Re: TSC not updating after resume: Bug or Feature?, Pavel Machek, (Wed Dec 24, 7:09 am)
Re: TSC not updating after resume: Bug or Feature?, Peter Zijlstra, (Fri Dec 26, 1:47 am)