From: "H. Peter Anvin" Subject: Re: lmbench lat_mmap slowdown with CONFIG_PARAVIRT Date: Thu, 22 Jan 2009 14:49:00 -0800 Message-ID: <4978F7DC.1040503@zytor.com> References: <20090120110542.GE19505@wotan.suse.de> <20090120112634.GA20858@elte.hu> <20090120140324.GA26424@elte.hu> <49763806.5090009@goop.org> <20090120205653.GA19710@elte.hu> <20090121072718.GN24891@wotan.suse.de> <4977A051.8050203@goop.org> <1232663311.16317.176.camel@bodhitayantram.eng.vmware.com> <4978F6C6.3090003@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4978F6C6.3090003@goop.org> Sender: linux-kernel-owner@vger.kernel.org To: Jeremy Fitzhardinge Cc: Zachary Amsden , Nick Piggin , Ingo Molnar , Linux Kernel Mailing List , Linus Torvalds , "jeremy@xensource.com" , "chrisw@sous-sol.org" , "rusty@rustcorp.com.au" , Andrew Morton , Xen-devel List-Id: xen-devel@lists.xenproject.org Jeremy Fitzhardinge wrote: > > I did have some patches to do that at one point. If you set pgd_val = > paravirt_nop, then the patching machinery will completely nop out the > call site. The problem is that it depends on the calling convention > using the same regs for the first arg and return - true for 32-bit, but > not 64. We could fix that with identity functions which the patcher > recognizes and can replace with either pure nops or inline appropriate > register moves. > There is also the option to use assembly wrappers to avoid relying on the calling convention. This is particularly so since we have sites where as little as a two-byte instruction gets bloated up with huge push/pop sequences around a tiny instruction. Those would be better served with a direct call to a stub (5 bytes), which would be repatched to the two-byte instruction + 3 byte nop. -hpa