From: Christian Borntraeger Subject: Re: [PATCH v2] kvm: Fix accounting of interrupts during guest execution on s390 Date: Thu, 15 Nov 2007 15:38:16 +0100 Message-ID: <200711151538.16774.borntraeger@de.ibm.com> References: <200711141632.37004.borntraeger@de.ibm.com> <200711151510.37076.borntraeger@de.ibm.com> <473C5652.9070706@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , Laurent Vivier To: Avi Kivity Return-path: In-Reply-To: <473C5652.9070706-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 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 Am Donnerstag, 15. November 2007 schrieb Avi Kivity: > > + if ((p->flags & PF_VCPU) && (irq_count() - hardirq_offset == 0)) [...] > What's irq_count()? Is it defined to ignore the timer tick? Or is that > hardirq_offset? hardirq_offset is used to ignore the timer tick. irq_count is defined in hardirq.h: #define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK)) So irq_count() - hardirq_offset is not zero if a hardirq or a softirq is running. By subtracting hardirq_offset (the timer tick sets it to HARDIRQ_OFFSET) it also makes sure, that the timer tick does not count as hardirq. This seems to do the trick. Christian ------------------------------------------------------------------------- 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/