From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Sheng" Subject: Re: KVM: VMX: cache exit_intr_info Date: Mon, 30 Jun 2008 20:43:49 +0800 Message-ID: <200806302043.49795.sheng.yang@intel.com> References: <20080627180519.GB18541@dmt.cnet> <200806281120.47995.sheng.yang@intel.com> <20080628053527.GA18734@dmt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm-devel To: Marcelo Tosatti Return-path: Received: from mga09.intel.com ([134.134.136.24]:4296 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753558AbYF3MnK (ORCPT ); Mon, 30 Jun 2008 08:43:10 -0400 In-Reply-To: <20080628053527.GA18734@dmt.cnet> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Saturday 28 June 2008 13:35:27 Marcelo Tosatti wrote: > On Sat, Jun 28, 2008 at 11:20:47AM +0800, Yang, Sheng wrote: > > On Saturday 28 June 2008 02:05:19 Marcelo Tosatti wrote: > > > exit_intr_info is read-only in nature, so once read it can be > > > cached similarly to idtv_vectoring_inf. > > > > > > Reduces guest re-entry in about 50 cycles on my machine (the > > > exception path should be similar, but haven't measured). > > > > > > Applies on top of register accessor patch. > > > > > > Signed-off-by: Marcelo Tosatti > > > > Thanks for the patches! :) > > > > And I realized there are also too much vmcs_read32 > > (CPU_BASED_VM_EXEC_CONTROL)(though not read only). I'd like to > > post another patch to optimize it later. > > GUEST_INTERRUPTIBILITY_INFO is also a candidate, with significant > wins (used by skip_emulated_instruction which is often used in the > exit handlers). > > GUEST_RFLAGS is another register read multiple times in the fast > path, but seems trickier. > > Do you have a better suggestion instead of > vmcs_cache_read32/vmcs_cache_write32 below for this caching > optimizations? I think we may include more MSRs, though not all of them in the critical path. GUEST_INTERRUPTIABILITY_INFO is on the critical path, as well as VM_ENTRY_INTR_INFO_FIELD. The GUEST_RFLAGS and CPU_BASED_VM_EXEC_CONTROL also been used very frequently. Of course the latter three MSR I mentioned need write cache support, I'd like to go the similar way as kvm_cache_regs did. > > With these three patches applied gettimeofday() microbenchmark is > 5% faster. I will test if we include these write cache MSR, how much benefit we can get. Can you provide some detail on how can you get the performance data? :) -- Thanks Yang, Sheng