From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [Patch 1/6] Cpupools: hypervisor part Date: Tue, 20 Apr 2010 13:45:53 +0100 Message-ID: References: <4BCD7623.1030507@ts.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4BCD7623.1030507@ts.fujitsu.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: Juergen Gross , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Juergen, I don't think there's any need to change the domain creation interfaces. Drop new domains into a default pool, and then they can moved out (even immediately) by further control operations. This will avoid changes to the domain-creation public and private interfaces. Also, you merge the cpu_add_remove_lock into a new cpupool_lock. That's not actually safe since cpu_add_remove_lock is held on entry to stopmachine_run(). Hence I assume now cpupool_lock is, and the only way to avoid deadlock possibilities would be for everyone to only spin_trylock on cpupool_lock, which isn't the case in your patch. Otherwise stopmachine_run can hang waiting for a CPU to enter its smr handler, while that CPU is waiting for the cpupool_lock to be released: a deadlock scenario. I think you'll really need to find a method of synchronisation with cpu hotplug which does not involve a lock that is held across stopmachine_run(). My first suggestion in this respect would be to take a look at cpu_disable_scheduler(). This function deschedules vcpus from a cpu being offlined, and notice you can go fairly hogwild with minimal locking restrictions because everyone else is in a stopmachine 'safe place' with irqs disabled. So they cannot concurrently conflict with you. So hooking yourself off cpu_disable_scheduler(), or adding some other new call-out from the end of __cpu_disable(), is quite probably the way to go to update cpupool info, break affinities, or whatever else you need to do. -- Keir On 20/04/2010 10:38, "Juergen Gross" wrote: