aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/vdso64/clock_getres.S
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-31 15:11:42 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-31 15:11:49 +0100
commitc742b31c03f37c5c499178f09f57381aa6c70131 (patch)
treedb0e95b8299d997fcb1264126bc8efe10d0ddd51 /arch/s390/kernel/vdso64/clock_getres.S
parent[PATCH] improve idle cputime accounting (diff)
downloadlinux-dev-c742b31c03f37c5c499178f09f57381aa6c70131.tar.xz
linux-dev-c742b31c03f37c5c499178f09f57381aa6c70131.zip
[PATCH] fast vdso implementation for CLOCK_THREAD_CPUTIME_ID
The extract cpu time instruction (ectg) instruction allows the user process to get the current thread cputime without calling into the kernel. The code that uses the instruction needs to switch to the access registers mode to get access to the per-cpu info page that contains the two base values that are needed to calculate the current cputime from the CPU timer with the ectg instruction. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/vdso64/clock_getres.S')
-rw-r--r--arch/s390/kernel/vdso64/clock_getres.S5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/s390/kernel/vdso64/clock_getres.S b/arch/s390/kernel/vdso64/clock_getres.S
index 488e31a3c0e7..9ce8caafdb4e 100644
--- a/arch/s390/kernel/vdso64/clock_getres.S
+++ b/arch/s390/kernel/vdso64/clock_getres.S
@@ -22,7 +22,12 @@ __kernel_clock_getres:
cghi %r2,CLOCK_REALTIME
je 0f
cghi %r2,CLOCK_MONOTONIC
+ je 0f
+ cghi %r2,-2 /* CLOCK_THREAD_CPUTIME_ID for this thread */
jne 2f
+ larl %r5,_vdso_data
+ icm %r0,15,__LC_ECTG_OK(%r5)
+ jz 2f
0: ltgr %r3,%r3
jz 1f /* res == NULL */
larl %r1,3f