From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] use per-cpu variables in cpufreq Date: Mon, 30 May 2011 10:45:29 +0100 Message-ID: References: <4DE32F6A.7030608@ts.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4DE32F6A.7030608@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 Cc: "Liu, Jinsong" , xen-devel@lists.xensource.com, mark.langsdorf@amd.com List-Id: xen-devel@lists.xenproject.org On 30/05/2011 06:47, "Juergen Gross" wrote: >> Specifically, my fear is that this data gets pushed into the hypervisor >> once-only during dom0 boot (via XENPF_set_processor_pminfo). If it is freed >> during processor offline, we lose it forever and have no power management >> when/if a CPU is brought back online. Worse I suspect your patch as it is >> will crash if some CPUs are offline during boot as you'll deference their >> per_cpu area which doesn't actually exist unless a CPU is online. You can >> test this for yourself by adding a maxcpus=1 boot parameter for Xen. > > Indeed. > > Just to understand this completely: > So when is this info set up for hot-plugged cpus? And what happens if > a cpu module is removed and later replaced by another module with > more cores (or threads) than the original one? > I think the processor pminfo should be set in this case during the hotplug > handling. Well, there is a difference between logical and physical cpu hotplug. Xen is capable of bringing CPUs online and offline without them actually being physically plugged/unplugged from the mainboard. Indeed our physical hotplug support is relatively new and I would suspect not much used (and it supports only physical insertion, not removal!). Frankly there are a number of questions around CPUs that are physically plugged in after boot: * How does per-CPU ACPI state like PM info get set up? * In a system where TSCs are otherwise all perfectly in sync, does the firmware help us by setting up the new CPUs' TSCs likewise? I don't actually know the answers to these questions. Maybe dom0 ACPI does get triggered on physical insertion and knows how to set up PM stuff? So, when I say CPU hotplug, or online/offline, I'm generally focussing on logical hotplug only still at the moment. Physical hotplug is a black art with question marks hanging over it for me. ;-) -- Keir >> The folding of the Intel/AMD structures might still be interesting, and >> probably belongs as a separate patch anyway. >> >> Cc'ing Intel and AMD guys to confirm this. > > Okay, I'm waiting for their opinion. > > > Juergen