diff options
Diffstat (limited to 'arch/s390/kernel/vtime.c')
| -rw-r--r-- | arch/s390/kernel/vtime.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 98f850e00008..a69a0911ed0e 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c | |||
| @@ -124,7 +124,7 @@ static void account_system_index_scaled(struct task_struct *p, u64 cputime, | |||
| 124 | */ | 124 | */ |
| 125 | static int do_account_vtime(struct task_struct *tsk) | 125 | static int do_account_vtime(struct task_struct *tsk) |
| 126 | { | 126 | { |
| 127 | u64 timer, clock, user, guest, system, hardirq, softirq, steal; | 127 | u64 timer, clock, user, guest, system, hardirq, softirq; |
| 128 | 128 | ||
| 129 | timer = S390_lowcore.last_update_timer; | 129 | timer = S390_lowcore.last_update_timer; |
| 130 | clock = S390_lowcore.last_update_clock; | 130 | clock = S390_lowcore.last_update_clock; |
| @@ -182,12 +182,6 @@ static int do_account_vtime(struct task_struct *tsk) | |||
| 182 | if (softirq) | 182 | if (softirq) |
| 183 | account_system_index_scaled(tsk, softirq, CPUTIME_SOFTIRQ); | 183 | account_system_index_scaled(tsk, softirq, CPUTIME_SOFTIRQ); |
| 184 | 184 | ||
| 185 | steal = S390_lowcore.steal_timer; | ||
| 186 | if ((s64) steal > 0) { | ||
| 187 | S390_lowcore.steal_timer = 0; | ||
| 188 | account_steal_time(cputime_to_nsecs(steal)); | ||
| 189 | } | ||
| 190 | |||
| 191 | return virt_timer_forward(user + guest + system + hardirq + softirq); | 185 | return virt_timer_forward(user + guest + system + hardirq + softirq); |
| 192 | } | 186 | } |
| 193 | 187 | ||
| @@ -213,8 +207,19 @@ void vtime_task_switch(struct task_struct *prev) | |||
| 213 | */ | 207 | */ |
| 214 | void vtime_flush(struct task_struct *tsk) | 208 | void vtime_flush(struct task_struct *tsk) |
| 215 | { | 209 | { |
| 210 | u64 steal, avg_steal; | ||
| 211 | |||
| 216 | if (do_account_vtime(tsk)) | 212 | if (do_account_vtime(tsk)) |
| 217 | virt_timer_expire(); | 213 | virt_timer_expire(); |
| 214 | |||
| 215 | steal = S390_lowcore.steal_timer; | ||
| 216 | avg_steal = S390_lowcore.avg_steal_timer / 2; | ||
| 217 | if ((s64) steal > 0) { | ||
| 218 | S390_lowcore.steal_timer = 0; | ||
| 219 | account_steal_time(steal); | ||
| 220 | avg_steal += steal; | ||
| 221 | } | ||
| 222 | S390_lowcore.avg_steal_timer = avg_steal; | ||
| 218 | } | 223 | } |
| 219 | 224 | ||
| 220 | /* | 225 | /* |
