Re: [PATCH 3/5] kvm: Directly account vtime to system on guest switch

2012-10-26 Thread Frederic Weisbecker
(Adding Christian Borntraeger in Cc) 2012/10/25 Frederic Weisbecker : > Switching to or from guest context is done on ioctl context. > So by the time we call kvm_guest_enter() or kvm_guest_exit() > we know we are not running the idle task. > > As a result, we can directly account the cputime usin

[PATCH 3/5] kvm: Directly account vtime to system on guest switch

2012-10-25 Thread Frederic Weisbecker
Switching to or from guest context is done on ioctl context. So by the time we call kvm_guest_enter() or kvm_guest_exit() we know we are not running the idle task. As a result, we can directly account the cputime using vtime_account_system(). There are two good reasons to do this: * We avoid som

Re: [PATCH 3/5] kvm: Directly account vtime to system on guest switch

2012-10-25 Thread Christian Borntraeger
On 25/10/12 09:56, Frederic Weisbecker wrote: [...] >>> * s390 doesn't disable irqs in its implementation of vtime_account(). >>> If vtime_account() in kvm races with an irq, the pending time might >>> be accounted twice. With vtime_account_system_irqsafe() we are protected. >> >> We disable irqs b

Re: [PATCH 3/5] kvm: Directly account vtime to system on guest switch

2012-10-25 Thread Frederic Weisbecker
2012/10/25 Christian Borntraeger : > On 25/10/12 02:51, Frederic Weisbecker wrote: >> Switching to or from guest context is done on ioctl context. >> So by the time we call kvm_guest_enter() or kvm_guest_exit() >> we know we are not running the idle task. >> >> As a result, we can directly account

Re: [PATCH 3/5] kvm: Directly account vtime to system on guest switch

2012-10-25 Thread Christian Borntraeger
On 25/10/12 02:51, Frederic Weisbecker wrote: > Switching to or from guest context is done on ioctl context. > So by the time we call kvm_guest_enter() or kvm_guest_exit() > we know we are not running the idle task. > > As a result, we can directly account the cputime using > vtime_account_system_

[PATCH 3/5] kvm: Directly account vtime to system on guest switch

2012-10-24 Thread Frederic Weisbecker
Switching to or from guest context is done on ioctl context. So by the time we call kvm_guest_enter() or kvm_guest_exit() we know we are not running the idle task. As a result, we can directly account the cputime using vtime_account_system_irqsafe(). There are two good reasons to do this: * We a