From: Keir Fraser Subject: Re: Re: [PATCH] EPT: Flush running cpus, add mask to flush when scheduled in Date: Tue, 22 Sep 2009 09:07:17 +0100 Message-ID: References: <4AB893D60200007800016283@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4AB893D60200007800016283@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich , George Dunlap Cc: Xiaohui Xin , Xin Li , Tim Deegan , Paul Durrant , Jun Nakajima , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 22/09/2009 08:07, "Jan Beulich" wrote: > Passing a pointer to the global cpu mask looks racy here: What if a CPU > disappears from domain_dirty_cpumask under your feet? I'm fixing this race before I apply the patch. > Also, merely using cpus_complement() here seem inefficient: It should be > possible to accumulate the flush activity, and avoid re-flushing on a CPU > which e.g. got flushed on the second from the last run through this code > (and not dirtied afterwards). I.e. I'd think there should be cpus_andnot() > here, and setting of the bits as CPUs get dirtied. I don't see how that is possible, as domain_dirty_cpumask can have changed arbitrarily since the previous invocation of ept_sync_domain(), as can the EPT tables. We have to assume every CPU has potentially stale cached mappings. -- Keir