From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCH 0/8] KVM updates for 2.6.20-rc2 Date: Thu, 28 Dec 2006 14:37:46 +0100 Message-ID: <20061228133746.GC3392@elte.hu> References: <45939755.7010603@qumranet.com> <20061228103345.GA4708@elte.hu> <4593A4B7.2070404@qumranet.com> <20061228113038.GA16190@elte.hu> <4593B948.5090009@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel Return-path: To: Avi Kivity Content-Disposition: inline In-Reply-To: <4593B948.5090009-atKUWr5tajBWk0Htik3J/w@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 * Avi Kivity wrote: > 3. The most expensive vmx context switch involves cpu migration: > > cpu 0: vmclear vm1 /* decache vmx context into memory */ > cpu 1: vmptrld vm1 > ... vm register access > vmlaunch ah. And you optimize this away if previously-used-CPU == curr-CPU and the vmx context loaded on this CPU is the same as we are trying to run now, right? > The vmlaunch instruction, like vmresume, causes a VM entry, but is > documented to be significantly more expensive. It is required after a > vmclear. > > Currently, the vmclear is performed by an ipi, because we can only > detect migration after the fact. However, if we enlist the migration > threads, we can vmclear before the process has left the cpu. the most common type of migration isnt even in the migration threads but in simple try_to_wake_up(). And that call often does not run on the CPU that has the VMX state ... i see no easy solution here - this really parallels all the lazy-FPU problems. Would it really be all that expensive to just save/load the VMX state in switch_to()? As SVN has shown it, we can rely on VMX state save/load to become faster in the future. So we definitely shouldnt design for a small-scale overhead in first-generation silicon. Ingo ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV