public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm: Fix accounting of interrupts during guest execution on s390
@ 2007-11-14 15:32 Christian Borntraeger
       [not found] ` <200711141632.37004.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Christian Borntraeger @ 2007-11-14 15:32 UTC (permalink / raw)
  To: kvm-devel; +Cc: Laurent Vivier, Avi Kivity

Avi, Ingo, Laurent,

what do you think about the following patch?

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
these interrupts to be accounted as guest time.
Solution is to check for in_interrupt to let interrupt time 
account as soft or hardirq.

Signed-off-by: Christian Borntraeger <borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
---
 kernel/sched.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: kvm/kernel/sched.c
===================================================================
--- kvm.orig/kernel/sched.c
+++ kvm/kernel/sched.c
@@ -3395,7 +3395,7 @@ void account_system_time(struct task_str
 	struct rq *rq = this_rq();
 	cputime64_t tmp;
 
-	if (p->flags & PF_VCPU) {
+	if ((p->flags & PF_VCPU) && !in_interrupt()) {
 		account_guest_time(p, cputime);
 		return;
 	}

-------------------------------------------------------------------------
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/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-11-15 18:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-14 15:32 [PATCH] kvm: Fix accounting of interrupts during guest execution on s390 Christian Borntraeger
     [not found] ` <200711141632.37004.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-11-14 15:36   ` Ingo Molnar
     [not found]     ` <20071114153651.GA3441-X9Un+BFzKDI@public.gmane.org>
2007-11-14 15:47       ` Christian Borntraeger
     [not found]         ` <200711141647.45810.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-11-14 16:04           ` Avi Kivity
     [not found]             ` <473B1C97.2010007-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-14 16:07               ` Christian Borntraeger
2007-11-15 14:10               ` [PATCH v2] " Christian Borntraeger
     [not found]                 ` <200711151510.37076.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-11-15 14:18                   ` Ingo Molnar
2007-11-15 14:23                   ` Avi Kivity
     [not found]                     ` <473C5652.9070706-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-15 14:38                       ` Christian Borntraeger
     [not found]                         ` <200711151538.16774.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-11-15 14:40                           ` Avi Kivity
2007-11-15 15:24                   ` Laurent Vivier
2007-11-15 15:56                     ` Christian Borntraeger
     [not found]                       ` <200711151656.44935.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-11-15 17:08                         ` Laurent Vivier
2007-11-15 18:05                           ` Christian Borntraeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox