Re: sched_clock and device suspend/resume

From: Steven Rostedt
Date: Wed Jul 10 2019 - 15:13:40 EST



[ Removed the two emails that were bouncing ]

On Wed, 10 Jul 2019 21:06:57 +0200 (CEST)
Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:

> > > > sched_clock_continuous() ? (I know, horrible name), that simply keeps
> > > > track of the time delta at suspend and returns:
> > > >
> > > > sched_clock() + delta;
> > >
> > > Which you get already when you do
> > >
> > > # echo boot > /sys/kernel/debug/tracing/trace_clock
> > >
> >
> > So basically the answer here is to change printk to use
> > ktime_get_boot_fast_ns() instead of local_clock()?
>
> Aargh. That was tracing.
>
> There was a patchset floating around which actually implemented that clock
> choice for sched_clock as well. Don't know why that was never merged.

Will it cause issues with the scheduler though. If it doesn't stop
during suspend, can't that make the scheduler think that processes were
using the CPU during the entire suspend and screw up the accounting?

-- Steve