remarkable-linux/arch/parisc
Helge Deller 54b6680090 parisc: Add native high-resolution sched_clock() implementation
Add a native implementation for the sched_clock() function which utilizes the
processor-internal cycle counter (Control Register 16) as high-resolution time
source.

With this patch we now get much more fine-grained resolutions in various
in-kernel time measurements (e.g. when viewing the function tracing logs), and
probably a more accurate scheduling on SMP systems.

There are a few specific implementation details in this patch:

1. On a 32bit kernel we emulate the higher 32bits of the required 64-bit
resolution of sched_clock() by increasing a per-cpu counter at every
wrap-around of the 32bit cycle counter.

2. In a SMP system, the cycle counters of the various CPUs are not syncronized
(similiar to the TSC in a x86_64 system). To cope with this we define
HAVE_UNSTABLE_SCHED_CLOCK and let the upper layers do the adjustment work.

3. Since we need HAVE_UNSTABLE_SCHED_CLOCK, we need to provide a cmpxchg64()
function even on a 32-bit kernel.

4. A 64-bit SMP kernel which is started on a UP system will mark the
sched_clock() implementation as "stable", which means that we don't expect any
jumps in the returned counter. This is true because we then run only on one
CPU.

Signed-off-by: Helge Deller <deller@gmx.de>
2016-05-22 21:39:25 +02:00
..
configs KEYS: CONFIG_KEYS_DEBUG_PROC_KEYS is no longer an option 2016-02-10 10:13:27 +00:00
include parisc: Add native high-resolution sched_clock() implementation 2016-05-22 21:39:25 +02:00
kernel parisc: Add native high-resolution sched_clock() implementation 2016-05-22 21:39:25 +02:00
lib parisc: Add native high-resolution sched_clock() implementation 2016-05-22 21:39:25 +02:00
math-emu parisc: remove duplicate define 2013-11-07 22:28:15 +01:00
mm parisc: Unbreak handling exceptions from kernel modules 2016-04-08 22:14:14 +02:00
oprofile
defpalo.conf parisc: switch to gzip-compressed vmlinuz kernel 2013-07-09 22:09:20 +02:00
install.sh parisc: make "make install" not depend on vmlinux 2013-11-07 22:28:06 +01:00
Kconfig parisc: Add native high-resolution sched_clock() implementation 2016-05-22 21:39:25 +02:00
Kconfig.debug parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
Makefile parisc: Fix ftrace function tracer 2016-04-14 17:47:19 +02:00
nm