sched: fix accounting of interrupts during guest execution on s390
authorChristian Borntraeger <borntraeger@de.ibm.com>
Thu, 15 Nov 2007 19:57:39 +0000 (20:57 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 15 Nov 2007 19:57:39 +0000 (20:57 +0100)
commit9778385db35a799d410039be123044a0d3e917a2
tree20564e6fabb5bdd86a13fc56ae0a6c880a9ccf6e
parent99fee6d7e5748d96884667a4628118f7fc130ea0
sched: fix accounting of interrupts during guest execution on s390

Currently the scheduler checks for PF_VCPU to decide if this timeslice
has to be accounted as guest time. On s390 host interrupts are not
disabled during guest execution. This causes theses interrupts to be
accounted as guest time if CONFIG_VIRT_CPU_ACCOUNTING is set. Solution
is to check if an interrupt triggered account_system_time. As the tick
is timer interrupt based, we have to subtract hardirq_offset.

I tested the patch on s390 with CONFIG_VIRT_CPU_ACCOUNTING and on
x86_64. Seems to work.

CC: Avi Kivity <avi@qumranet.com>
CC: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched.c