From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v2] kvm: Fix accounting of interrupts during guest execution on s390 Date: Thu, 15 Nov 2007 16:40:58 +0200 Message-ID: <473C5A7A.3040003@qumranet.com> References: <200711141632.37004.borntraeger@de.ibm.com> <200711151510.37076.borntraeger@de.ibm.com> <473C5652.9070706@qumranet.com> <200711151538.16774.borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , Laurent Vivier To: Christian Borntraeger Return-path: In-Reply-To: <200711151538.16774.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org> 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 Christian Borntraeger wrote: > 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. > > Ah, ok. Thanks for the explanation. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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/