From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Gross Subject: Re: [PATCH] Allow ACPI state change with active cpupools Date: Wed, 21 Mar 2012 14:46:30 +0100 Message-ID: <4F69DBB6.2020400@ts.fujitsu.com> References: 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: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 03/20/2012 03:55 PM, Keir Fraser wrote: > On 20/03/2012 14:46, "Juergen Gross" wrote: > >>> Is it better to have cpupools know about offlining/suspend, or have >>> offlining/suspend know about cpupools? I would have thought the latter makes >>> more sense since it is offlining/suspend which calls into the cpupool >>> subsystem. >> I thought of a more relaxed solution in the cpupool coding: >> >> Instead of allowing to offline a cpu only if it is in Pool-0, I would allow it >> if: >> - the cpu is not the last one in the cpupool >> - or no domain is active in the cpupool (this would include the suspend case, >> where all domains are paused) >> >> Together with your proposal to remember the cpupool for an offlined cpu to add >> it again when it is onlined the handling should be rather simple and local. > Ah, I see. Yes, a more flexible policy like this in the cpupool subsystem is > best solution of all, imo. I have a problem with that solution. I had to change cpu_disable_scheduler() to do a vcpu_migrate() only if the vcpu is runnable. When the ACPI state change isn't permanent like in poweroff case I don't want to change vcpu affinities. This action might be necessary in vcpu_wake() if v->processor isn't usable for the vcpu any more. Unfortunately vcpu_migrate() is calling evtchn_move_pirqs(), which taking the domain event channel lock. And vcpu_wake() is called at least by send_evtchn() with that lock already hold... Is it possible to use spin_lock_recursive() for the domain event channel lock? Another solution would be to omit the vcpu_migrate() in cpu_disable_scheduler() for paused vcpus only and to do it when unpausing the vcpu, but this would leak scheduler internals... Juergen -- Juergen Gross Principal Developer Operating Systems PDG ES&S SWE OS6 Telephone: +49 (0) 89 3222 2967 Fujitsu Technology Solutions e-mail: juergen.gross@ts.fujitsu.com Domagkstr. 28 Internet: ts.fujitsu.com D-80807 Muenchen Company details: ts.fujitsu.com/imprint.html