diff options
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kernel/vtime.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 07283aea2e56..4a4a34caec55 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c | |||
@@ -55,13 +55,19 @@ void account_process_tick(struct task_struct *tsk, int user_tick) | |||
55 | cputime = S390_lowcore.system_timer >> 12; | 55 | cputime = S390_lowcore.system_timer >> 12; |
56 | S390_lowcore.system_timer -= cputime << 12; | 56 | S390_lowcore.system_timer -= cputime << 12; |
57 | S390_lowcore.steal_clock -= cputime << 12; | 57 | S390_lowcore.steal_clock -= cputime << 12; |
58 | account_system_time(tsk, HARDIRQ_OFFSET, cputime, cputime); | 58 | if (idle_task(smp_processor_id()) != current) |
59 | account_system_time(tsk, HARDIRQ_OFFSET, cputime, cputime); | ||
60 | else | ||
61 | account_idle_time(cputime); | ||
59 | 62 | ||
60 | cputime = S390_lowcore.steal_clock; | 63 | cputime = S390_lowcore.steal_clock; |
61 | if ((__s64) cputime > 0) { | 64 | if ((__s64) cputime > 0) { |
62 | cputime >>= 12; | 65 | cputime >>= 12; |
63 | S390_lowcore.steal_clock -= cputime << 12; | 66 | S390_lowcore.steal_clock -= cputime << 12; |
64 | account_steal_time(tsk, cputime); | 67 | if (idle_task(smp_processor_id()) != current) |
68 | account_steal_time(cputime); | ||
69 | else | ||
70 | account_idle_time(cputime); | ||
65 | } | 71 | } |
66 | } | 72 | } |
67 | 73 | ||
@@ -87,7 +93,10 @@ void account_vtime(struct task_struct *tsk) | |||
87 | cputime = S390_lowcore.system_timer >> 12; | 93 | cputime = S390_lowcore.system_timer >> 12; |
88 | S390_lowcore.system_timer -= cputime << 12; | 94 | S390_lowcore.system_timer -= cputime << 12; |
89 | S390_lowcore.steal_clock -= cputime << 12; | 95 | S390_lowcore.steal_clock -= cputime << 12; |
90 | account_system_time(tsk, 0, cputime, cputime); | 96 | if (idle_task(smp_processor_id()) != current) |
97 | account_system_time(tsk, 0, cputime, cputime); | ||
98 | else | ||
99 | account_idle_time(cputime); | ||
91 | } | 100 | } |
92 | 101 | ||
93 | /* | 102 | /* |
@@ -107,7 +116,10 @@ void account_system_vtime(struct task_struct *tsk) | |||
107 | cputime = S390_lowcore.system_timer >> 12; | 116 | cputime = S390_lowcore.system_timer >> 12; |
108 | S390_lowcore.system_timer -= cputime << 12; | 117 | S390_lowcore.system_timer -= cputime << 12; |
109 | S390_lowcore.steal_clock -= cputime << 12; | 118 | S390_lowcore.steal_clock -= cputime << 12; |
110 | account_system_time(tsk, 0, cputime, cputime); | 119 | if (in_irq() || idle_task(smp_processor_id()) != current) |
120 | account_system_time(tsk, 0, cputime, cputime); | ||
121 | else | ||
122 | account_idle_time(cputime); | ||
111 | } | 123 | } |
112 | EXPORT_SYMBOL_GPL(account_system_vtime); | 124 | EXPORT_SYMBOL_GPL(account_system_vtime); |
113 | 125 | ||