From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhigang Wang Subject: Re: xl: expose max_cpu_id from `xl info` Date: Wed, 14 Mar 2012 13:51:21 -0400 Message-ID: <4F60DA99.9020505@oracle.com> References: <4F5F7B49.9040001@citrix.com> <4F5F9CCF.9000400@oracle.com> <4F6076D1.3000804@citrix.com> <4F60BDBA.3040209@oracle.com> <4F60C639.1020307@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F60C639.1020307@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On 03/14/2012 12:24 PM, Andrew Cooper wrote: > >>>> Is this true: nr_cpus = max_cpu_id + 1 ? >>>> >>>> Zhigang >>> if and only if all cpus are online. >>> >>> nr_cpus is set to nr_online_cpus() in the hypercall, while max_cpu_id >>> is set to nr_cpu_ids-1. >>> >>> nr_cpus is liable to change during runtime, while max_cpu_id is not. >>> >>> ~Andrew >> If this is the case, I think nr_cpus is a bit confusing. Can we make >> it always representing the number of physical cpus (from hypervisor's >> viewpoint, not dom0)? >> >> Zhigang >> >> > No. The names here reflect the hypercall name parameters. The > hypercall cant be changed because it is an ABI, and the "name : value" > pairs here cant be changed because of backward compatibility with the > previous toolstack. > Ok. Thanks for you info. I think nr_online_cpus() is the right thing here: it represents online physical cpus from hypervisor's viewpoint. It's fine to add this output here if you need it. But for most of the xen users, the current nr_cpus should be what they want (for how many pcpus they can use). Other ways to get full hardware info could be BIOS/SMBIOS/DMI, and I think it's better than xl info. Thanks, Zhigang