If I remember correctly time accounting on s390 is more accurate than on x86 ?
Because on x86, as we make the kvm_guest_exit() after local_irq_enable() we can also have IRQ with PF_VCPU set... and we discussed a lot on probability to know if it was good or not. And on x86 it seems good because it is already working like that with system and user time (we account time to the space where tick appears). see http://lkml.org/lkml/2007/10/15/228 Laurent Le jeudi 15 novembre 2007 à 15:10 +0100, Christian Borntraeger a écrit : > Avi pointed out, that my first patch was broken, here is the 2nd try. > I tested the patch on s390 with CONFIG_VIRT_CPU_ACCOUNTING and on x86_64. > Seems to work. > > 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. > > Avi, Ingo, Laurent, feedback is welcome. > > CC: Ingo Molnar <[EMAIL PROTECTED]> > CC: Avi Kivity <[EMAIL PROTECTED]> > CC: Laurent Vivier <[EMAIL PROTECTED]> > Signed-off-by: Christian Borntraeger <[EMAIL PROTECTED]> > --- > kernel/sched.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > Index: kvm/kernel/sched.c > =================================================================== > --- kvm.orig/kernel/sched.c > +++ kvm/kernel/sched.c > @@ -3395,10 +3395,8 @@ void account_system_time(struct task_str > 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); > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > kvm-devel mailing list > kvm-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/kvm-devel -- ------------- [EMAIL PROTECTED] -------------- "Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
signature.asc
Description: Ceci est une partie de message numériquement signée
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel