Commit:     9778385db35a799d410039be123044a0d3e917a2
Parent:     99fee6d7e5748d96884667a4628118f7fc130ea0
Author:     Christian Borntraeger <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 15 20:57:39 2007 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Thu Nov 15 20:57:39 2007 +0100

    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 <[EMAIL PROTECTED]>
    CC: Laurent Vivier <[EMAIL PROTECTED]>
    Signed-off-by: Christian Borntraeger <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
 kernel/sched.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 4fb3532..908335e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3390,10 +3390,8 @@ void account_system_time(struct task_struct *p, int 
        struct rq *rq = this_rq();
        cputime64_t tmp;
-       if (p->flags & PF_VCPU) {
-               account_guest_time(p, cputime);
-               return;
-       }
+       if ((p->flags & PF_VCPU) && (irq_count() - hardirq_offset == 0))
+               return account_guest_time(p, cputime);
        p->stime = cputime_add(p->stime, cputime);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to