From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] xen: correctly check for pending events when restoring irq flags Date: Thu, 26 Apr 2012 16:08:14 -0400 Message-ID: <20120426200814.GA1130@phenom.dumpdata.com> References: <1335465846-22229-1-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1335465846-22229-1-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Thu, Apr 26, 2012 at 07:44:06PM +0100, David Vrabel wrote: > From: David Vrabel > > In xen_restore_fl_direct(), xen_force_evtchn_callback() was being > called even if no events were pending. This resulted in (depending on > workload) about a 100 times as many xen_version hypercalls as > necessary. > > Fix this by correcting the sense of the conditional jump. > > This seems to give a significant performance benefit for some > workloads. > Will put stable@kernel.org here as well. Thx! > Signed-off-by: David Vrabel > --- > I'd prefer to do more testing and benchmarking but the gains appear to > be significant. e.g., lmbench3's 'lat_proc fork' test has improved > from 404 us to 357 us (~11% faster). > --- > arch/x86/xen/xen-asm.S | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S > index 79d7362..3e45aa0 100644 > --- a/arch/x86/xen/xen-asm.S > +++ b/arch/x86/xen/xen-asm.S > @@ -96,7 +96,7 @@ ENTRY(xen_restore_fl_direct) > > /* check for unmasked and pending */ > cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_pending > - jz 1f > + jnz 1f > 2: call check_events > 1: > ENDPATCH(xen_restore_fl_direct) > -- > 1.7.2.5