aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2013-12-02 08:54:56 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-12-02 09:31:10 -0500
commitb5e64b3de7fdd1db0a12871f7114fc1da899df8e (patch)
treef6c7dae3006a8f16ecfea0d8f6b2ae0c83ea69df /arch/s390
parent06aae6834eb473c94a2493c145fc3e6c9fcf26a5 (diff)
s390/vdso: ectg gettime support for CLOCK_THREAD_CPUTIME_ID
The code to use the ECTG instruction to calculate the cputime for the current thread is currently used only for the per-thread CPU-clock with the clockid -2 (PID=0, VIRT=1). Use the same code for the clockid CLOCK_THREAD_CPUTIME_ID to speed up the more common clockid as well. Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/asm-offsets.c1
-rw-r--r--arch/s390/kernel/vdso64/clock_getres.S4
-rw-r--r--arch/s390/kernel/vdso64/clock_gettime.S4
3 files changed, 7 insertions, 2 deletions
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index 496116cd65ec..e4c99a183651 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -72,6 +72,7 @@ int main(void)
72 /* constants used by the vdso */ 72 /* constants used by the vdso */
73 DEFINE(__CLOCK_REALTIME, CLOCK_REALTIME); 73 DEFINE(__CLOCK_REALTIME, CLOCK_REALTIME);
74 DEFINE(__CLOCK_MONOTONIC, CLOCK_MONOTONIC); 74 DEFINE(__CLOCK_MONOTONIC, CLOCK_MONOTONIC);
75 DEFINE(__CLOCK_THREAD_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID);
75 DEFINE(__CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC); 76 DEFINE(__CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC);
76 BLANK(); 77 BLANK();
77 /* idle data offsets */ 78 /* idle data offsets */
diff --git a/arch/s390/kernel/vdso64/clock_getres.S b/arch/s390/kernel/vdso64/clock_getres.S
index 176e1f75f9aa..34deba7c7ed1 100644
--- a/arch/s390/kernel/vdso64/clock_getres.S
+++ b/arch/s390/kernel/vdso64/clock_getres.S
@@ -23,7 +23,9 @@ __kernel_clock_getres:
23 je 0f 23 je 0f
24 cghi %r2,__CLOCK_MONOTONIC 24 cghi %r2,__CLOCK_MONOTONIC
25 je 0f 25 je 0f
26 cghi %r2,-2 /* CLOCK_THREAD_CPUTIME_ID for this thread */ 26 cghi %r2,__CLOCK_THREAD_CPUTIME_ID
27 je 0f
28 cghi %r2,-2 /* Per-thread CPUCLOCK with PID=0, VIRT=1 */
27 jne 2f 29 jne 2f
28 larl %r5,_vdso_data 30 larl %r5,_vdso_data
29 icm %r0,15,__LC_ECTG_OK(%r5) 31 icm %r0,15,__LC_ECTG_OK(%r5)
diff --git a/arch/s390/kernel/vdso64/clock_gettime.S b/arch/s390/kernel/vdso64/clock_gettime.S
index 0add1072ba30..4007007a9652 100644
--- a/arch/s390/kernel/vdso64/clock_gettime.S
+++ b/arch/s390/kernel/vdso64/clock_gettime.S
@@ -22,7 +22,9 @@ __kernel_clock_gettime:
22 larl %r5,_vdso_data 22 larl %r5,_vdso_data
23 cghi %r2,__CLOCK_REALTIME 23 cghi %r2,__CLOCK_REALTIME
24 je 4f 24 je 4f
25 cghi %r2,-2 /* CLOCK_THREAD_CPUTIME_ID for this thread */ 25 cghi %r2,__CLOCK_THREAD_CPUTIME_ID
26 je 9f
27 cghi %r2,-2 /* Per-thread CPUCLOCK with PID=0, VIRT=1 */
26 je 9f 28 je 9f
27 cghi %r2,__CLOCK_MONOTONIC 29 cghi %r2,__CLOCK_MONOTONIC
28 jne 12f 30 jne 12f