From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH][retry 1] Add support for Pause Filtering to AMD SVM Date: Mon, 11 May 2009 18:28:38 +0300 Message-ID: <4A084426.2080604@redhat.com> References: <200905050909.58583.mark.langsdorf@amd.com> <20090507135522.GJ4059@amd.com> <200905071000.14038.mark.langsdorf@amd.com> <4A02FECC.6060609@redhat.com> <20090511141503.GC6175@elte.hu> <4A083539.407@redhat.com> <20090511143320.GE6175@elte.hu> <4A083B69.6010702@redhat.com> <20090511145903.GB737@elte.hu> <4A08405E.3070709@redhat.com> <20090511151823.GC9492@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Peter Zijlstra , Mark Langsdorf , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Ingo Molnar Return-path: Received: from mx2.redhat.com ([66.187.237.31]:43647 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752791AbZEKP3N (ORCPT ); Mon, 11 May 2009 11:29:13 -0400 In-Reply-To: <20090511151823.GC9492@elte.hu> Sender: kvm-owner@vger.kernel.org List-ID: Ingo Molnar wrote: > * Avi Kivity wrote: > > >>> I.e. the 3000 cycles value itself could be eliminated as well. >>> (with just a common-sense max of say 100,000 cycles enforced) >>> >> Yeah, though that has a much smaller effect as it's only >> responsible for a few microseconds of spinning. >> > > 3000 cycles would be 1-2 usecs. Isnt the VM exit+entry cost still in > that range? > It's 3000 executions of rep nop, so you need to account for the entire spinlock loop body. The Linux spinlock is "1:\t" "cmpl %0, %2\n\t" "je 2f\n\t" "rep ; nop\n\t" "movzwl %1, %2\n\t" /* don't need lfence here, because loads are in-order */ "jmp 1b\n" 5 instructions, maybe 2-3 cycles, not counting any special rep nop overhead. Mark, any idea what the spin time is? VM entry/exit is around 1us on the newer processors. -- error compiling committee.c: too many arguments to function