From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [RFC] Interrupt latency measurement technique Date: Thu, 28 Aug 2014 18:47:07 +0100 Message-ID: <1409248027.21481.15.camel@citrix.com> References: <1409188042.28009.96.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrii Tseglytskyi Cc: Julien Grall , Stefano Stabellini , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Thu, 2014-08-28 at 10:58 +0300, Andrii Tseglytskyi wrote: > Hi Ian > > On Thu, Aug 28, 2014 at 4:07 AM, Ian Campbell wrote: > > On Wed, 2014-08-27 at 12:14 +0300, Andrii Tseglytskyi wrote: > >> Hi, > >> > >> I need to measure IRQ latency introduced by Xen: (GIC -> Xen IRQ > >> handler -> Dom0 IRQ handler) > >> I need to know how many time I spend in Xen IRQ handler. > >> > >> Can someone comment - is the following algorithm works: > >> > >> - in function xen/arch/arm/gic.c: gic_interrupt() store timer counter value: > >> xen_timer_val = READ_SYSREG64(CNTPCT_EL0) - READ_SYSREG64(CNTVOFF_EL2) > >> > >> - in any IRQ handler in dom0 store timer counter value: > >> dom0_timer_val = READ_SYSREG64(CNTPCT_EL0) > >> > >> - calculate time diff in nanoseconds: > >> time_diff_ns = ticks_to_ns(dom0_timer_val - xen_timer_val) > >> > >> Using this technique I measured display IRQ latency and got about > >> - 20 to 30 usec latency on 1 GHz MPU frequency > >> - 10 to 20 usec latencyon 1.5 GHz MPU frequency > >> > >> Are these numbers expectable? > > > > How do they compare to just native Linux? > > > > Never measured native Linux. I just need to measure overhead, introduced by Xen. > So I take a time difference between git_interrupt() in Xen and > gic_interrupt() in Linux. OK. I'm afraid I don't have much of a reference point for these numbers so I don't know if 30usec is e.g .1% additional overhead or 100%.