Skip to content

Commit a9e7152

Browse files
hcahcaSasha Levin
authored andcommitted
s390/vtime: Fix virtual timer forwarding
[ Upstream commit dbc0fb3 ] Since delayed accounting of system time [1] the virtual timer is forwarded by do_account_vtime() but also vtime_account_kernel(), vtime_account_softirq(), and vtime_account_hardirq(). This leads to double accounting of system, guest, softirq, and hardirq time. Remove accounting from the vtime_account*() family to restore old behavior. There is only one user of the vtimer interface, which might explain why nobody noticed this so far. Fixes: b7394a5 ("sched/cputime, s390: Implement delayed accounting of system time") [1] Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0d38547 commit a9e7152

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

arch/s390/kernel/vtime.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,6 @@ static u64 vtime_delta(void)
225225
return timer - lc->last_update_timer;
226226
}
227227

228-
/*
229-
* Update process times based on virtual cpu times stored by entry.S
230-
* to the lowcore fields user_timer, system_timer & steal_clock.
231-
*/
232228
void vtime_account_kernel(struct task_struct *tsk)
233229
{
234230
struct lowcore *lc = get_lowcore();
@@ -238,27 +234,17 @@ void vtime_account_kernel(struct task_struct *tsk)
238234
lc->guest_timer += delta;
239235
else
240236
lc->system_timer += delta;
241-
242-
virt_timer_forward(delta);
243237
}
244238
EXPORT_SYMBOL_GPL(vtime_account_kernel);
245239

246240
void vtime_account_softirq(struct task_struct *tsk)
247241
{
248-
u64 delta = vtime_delta();
249-
250-
get_lowcore()->softirq_timer += delta;
251-
252-
virt_timer_forward(delta);
242+
get_lowcore()->softirq_timer += vtime_delta();
253243
}
254244

255245
void vtime_account_hardirq(struct task_struct *tsk)
256246
{
257-
u64 delta = vtime_delta();
258-
259-
get_lowcore()->hardirq_timer += delta;
260-
261-
virt_timer_forward(delta);
247+
get_lowcore()->hardirq_timer += vtime_delta();
262248
}
263249

264250
/*

0 commit comments

Comments
 (0)