diff options
Diffstat (limited to 'arch/s390/kernel/vtime.c')
-rw-r--r-- | arch/s390/kernel/vtime.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 22a895ecb7a4..dfe6f0856617 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c | |||
@@ -32,7 +32,7 @@ DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer); | |||
32 | * Update process times based on virtual cpu times stored by entry.S | 32 | * Update process times based on virtual cpu times stored by entry.S |
33 | * to the lowcore fields user_timer, system_timer & steal_clock. | 33 | * to the lowcore fields user_timer, system_timer & steal_clock. |
34 | */ | 34 | */ |
35 | void account_user_vtime(struct task_struct *tsk) | 35 | void account_tick_vtime(struct task_struct *tsk) |
36 | { | 36 | { |
37 | cputime_t cputime; | 37 | cputime_t cputime; |
38 | __u64 timer, clock; | 38 | __u64 timer, clock; |
@@ -76,6 +76,31 @@ void account_user_vtime(struct task_struct *tsk) | |||
76 | * Update process times based on virtual cpu times stored by entry.S | 76 | * Update process times based on virtual cpu times stored by entry.S |
77 | * to the lowcore fields user_timer, system_timer & steal_clock. | 77 | * to the lowcore fields user_timer, system_timer & steal_clock. |
78 | */ | 78 | */ |
79 | void account_vtime(struct task_struct *tsk) | ||
80 | { | ||
81 | cputime_t cputime; | ||
82 | __u64 timer; | ||
83 | |||
84 | timer = S390_lowcore.last_update_timer; | ||
85 | asm volatile (" STPT %0" /* Store current cpu timer value */ | ||
86 | : "=m" (S390_lowcore.last_update_timer) ); | ||
87 | S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer; | ||
88 | |||
89 | cputime = S390_lowcore.user_timer >> 12; | ||
90 | S390_lowcore.user_timer -= cputime << 12; | ||
91 | S390_lowcore.steal_clock -= cputime << 12; | ||
92 | account_user_time(tsk, cputime); | ||
93 | |||
94 | cputime = S390_lowcore.system_timer >> 12; | ||
95 | S390_lowcore.system_timer -= cputime << 12; | ||
96 | S390_lowcore.steal_clock -= cputime << 12; | ||
97 | account_system_time(tsk, 0, cputime); | ||
98 | } | ||
99 | |||
100 | /* | ||
101 | * Update process times based on virtual cpu times stored by entry.S | ||
102 | * to the lowcore fields user_timer, system_timer & steal_clock. | ||
103 | */ | ||
79 | void account_system_vtime(struct task_struct *tsk) | 104 | void account_system_vtime(struct task_struct *tsk) |
80 | { | 105 | { |
81 | cputime_t cputime; | 106 | cputime_t cputime; |