From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kai Huang Subject: Re: PML (Page Modification Logging) design for Xen Date: Thu, 12 Feb 2015 15:15:57 +0800 Message-ID: <54DC532D.2020608@linux.intel.com> References: <54DB129D.3060102@linux.intel.com> <54DB4294.1080406@citrix.com> <54DC1249.60507@linux.intel.com> <54DC4EB7.3030105@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Tian, Kevin" , Andrew Cooper , "jbeulich@suse.com" , "tim@xen.org" , "keir@xen.org" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 02/12/2015 03:09 PM, Tian, Kevin wrote: >> From: Kai Huang [mailto:kai.huang@linux.intel.com] >> Sent: Thursday, February 12, 2015 2:57 PM >> >> On 02/12/2015 02:54 PM, Tian, Kevin wrote: >>>> From: Kai Huang [mailto:kai.huang@linux.intel.com] >>>> Sent: Thursday, February 12, 2015 10:39 AM >>>>>> PML needs to be enabled (allocate PML buffer, initialize PML index, >>>>>> PML base address, turn PML on VMCS, etc) for all vcpus of the domain, >>>>>> as PML buffer and PML index are per-vcpu, but EPT table may be shared >>>>>> by vcpus. Enabling PML on partial vcpus of the domain won't work. Also >>>>>> PML will only be enabled for the domain when it is switched to dirty >>>>>> logging mode, and it will be disabled when domain is switched back to >>>>>> normal mode. As looks vcpu number won't be changed dynamically >> during >>>>>> guest is running (correct me if I am wrong here), so we don't have to >>>>>> consider enabling PML for new created vcpu when guest is in dirty >>>>>> logging mode. >>>>> There are exactly d->max_vcpus worth of struct vcpus (and therefore >>>>> VMCSes) for a domain after creation, and will exist for the lifetime of >>>>> the domain. There is no dynamic adjustment of numbers of vcpus during >>>>> runtime. >>>> Good to know. >>> could we at least detect and warn vcpu changes when PML is enabled? >>> dirty logging happens out of guest's knowledge and there could be the >>> case where user right online/offline a vcpu within that window. >> Why is the warning necessary? There's no harm leaving PML enabled when >> vcpu becomes offline. > what about online? you need enable PML for newly-online vcpu since > meaningful work may be scheduled to it within logdirty window. Do you mean vcpu number (those offline + those online) can be changed during guest's runtime, ex, a new vcpu is created and becomes online after PML is enabled for the domain? Otherwise, I don't see a problem. As long as the total number of vcpus remains constant, it's not a problem, as we only enable PML after all vcpus are created (and it remains constant), and the vcpu status is irrelevant. Thanks, -Kai > >> Also we will not disable PML for that vcpu when it becomes offline, in >> which case we don't need to re-enable PML, which can fail, when vcpu >> becomes online again. It simplifies the logic. > offline is not a problem > > Thanks > Kevin >