linux/arch
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
..
alpha lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
arc lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
arm lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
arm64 exit_thread: remove empty bodies 2016-05-20 17:58:30 -07:00
avr32 printk/nmi: generic solution for safe printk in NMI 2016-05-20 17:58:30 -07:00
blackfin printk/nmi: generic solution for safe printk in NMI 2016-05-20 17:58:30 -07:00
c6x exit_thread: remove empty bodies 2016-05-20 17:58:30 -07:00
cris printk/nmi: generic solution for safe printk in NMI 2016-05-20 17:58:30 -07:00
frv exit_thread: remove empty bodies 2016-05-20 17:58:30 -07:00
h8300 lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
hexagon exit_thread: remove empty bodies 2016-05-20 17:58:30 -07:00
ia64 Merge branch 'akpm' (patches from Andrew) 2016-05-20 22:31:33 -07:00
m32r lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
m68k lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
metag lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
microblaze lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
mips Merge branch 'akpm' (patches from Andrew) 2016-05-20 22:31:33 -07:00
mn10300 exit_thread: accept a task parameter to be exited 2016-05-20 17:58:30 -07:00
nios2 lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
openrisc lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
parisc parisc: Add native high-resolution sched_clock() implementation 2016-05-22 21:39:25 +02:00
powerpc printk/nmi: generic solution for safe printk in NMI 2016-05-20 17:58:30 -07:00
s390 lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
score lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
sh lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
sparc lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00
tile printk/nmi: generic solution for safe printk in NMI 2016-05-20 17:58:30 -07:00
um exit_thread: remove empty bodies 2016-05-20 17:58:30 -07:00
unicore32 exit_thread: remove empty bodies 2016-05-20 17:58:30 -07:00
x86 x86 isa: add back X86_32 dependency on CONFIG_ISA 2016-05-21 10:25:19 -07:00
xtensa exit_thread: accept a task parameter to be exited 2016-05-20 17:58:30 -07:00
.gitignore
Kconfig lib/GCD.c: use binary GCD algorithm instead of Euclidean 2016-05-20 17:58:30 -07:00