From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: SMP support of MMU Date: Wed, 30 May 2007 07:53:45 +0300 Message-ID: <465D0359.7040908@qumranet.com> References: <10EA09EFD8728347A513008B6B0DA77A0184129A@pdsmsx411.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "Dong, Eddie" Return-path: In-Reply-To: <10EA09EFD8728347A513008B6B0DA77A0184129A-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@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 Dong, Eddie wrote: > Avi: > I noticed the current MMU data structure is defined as per VCPU > such as: > > struct kvm_vcpu { > ..... > struct list_head free_pages; > struct kvm_mmu_page page_header_buf[KVM_NUM_MMU_PAGES]; > ..... > } > > This is a hot topics in Xen development time: whether should we > support global shadow PT or per VCPU shadow PT? Per VCPU shadow is much > close to native from architecture point of view, but definitely much > complicated in implementation. Do we really need to implement per VCPU > shadow? Xen today is still global shadow. > If global shadow is good enough, then I will try to move > free_pages and page_header_buf[KVM_NUM_MMU_PAGES] to struct kvm. > Comments? > I think a global shadow is actually better. Consider a multithreaded application where threads are free to migrate (e.g. many more threads than vcpus); a per-vcpu shadow will cause many more faults than a global shadow. I have patch that converts page_header_buf into a slab cache; that should remove the per-vcpu fields. I just have to debug it before I can apply it. I'll dig it up. (the reason they are actually in kvm_vcpu is that we started with a non-caching mmu implementation, where you can't share pages anyway) -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/