Re: [PATCH] clocksource: document some basic concepts

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Monday, November 15, 2010 - 3:48 am

On Mon, 2010-11-15 at 11:33 +0100, Linus Walleij wrote:

Not so, we prefer it be synchronized and monotonic, but we don't require
so, see below.


Currently true, John Stultz was going to look into ammending this by
teaching the kernel/sched_clock.c bits about early wraps (and a way for
architectures to specify this)

#define SCHED_CLOCK_WRAP_BITS 48

...

#ifdef SCHED_CLOCK_WRAP_BITS
  /* handle short wraps */
#endif

foo for wrap_min/wrap_max and "delta = now - scd->tick_raw" like things
might work.


sched_clock() need not be synchronized between CPUs, nor even be
monotonic, we prefer a fast high res clock over a slow one,
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK provides infrastructure to sanitize the
output of sched_clock().

[ of course we prefer a fast and synchronized clock, but we take fast
over synchronized ]

sched_clock() requires local IRQs to be disabled.

Therefore, sched_clock() shall not be used, see kernel/sched_clock.c for
detail and alternative interfaces.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] clocksource: document some basic concepts, Linus Walleij, (Mon Nov 15, 3:33 am)
Re: [PATCH] clocksource: document some basic concepts, Peter Zijlstra, (Mon Nov 15, 3:48 am)
Re: [PATCH] clocksource: document some basic concepts, Peter Zijlstra, (Mon Nov 15, 3:50 am)
Re: [PATCH] clocksource: document some basic concepts, Randy Dunlap, (Mon Nov 15, 9:34 am)
Re: [PATCH] clocksource: document some basic concepts, john stultz, (Mon Nov 15, 12:45 pm)
Re: [PATCH] clocksource: document some basic concepts, john stultz, (Mon Nov 15, 12:48 pm)
Re: [PATCH] clocksource: document some basic concepts, Nicolas Pitre, (Mon Nov 15, 1:06 pm)
Re: [PATCH] clocksource: document some basic concepts, Peter Zijlstra, (Mon Nov 15, 2:13 pm)