From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: [PATCH] kvm: Fix accounting of interrupts during guest execution on s390 Date: Wed, 14 Nov 2007 16:32:36 +0100 Message-ID: <200711141632.37004.borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Laurent Vivier , Avi Kivity To: kvm-devel Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org 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 --- 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/