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 11:48:10 -0400 Message-ID: <4F60BDBA.3040209@oracle.com> References: <4F5F7B49.9040001@citrix.com> <4F5F9CCF.9000400@oracle.com> <4F6076D1.3000804@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0985157212367887099==" Return-path: In-Reply-To: <4F6076D1.3000804@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 This is a multi-part message in MIME format. --===============0985157212367887099== Content-Type: multipart/alternative; boundary="------------080103060309000701050900" This is a multi-part message in MIME format. --------------080103060309000701050900 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 03/14/2012 06:45 AM, Andrew Cooper wrote: > On 13/03/12 19:15, Zhigang Wang wrote: >> On 03/13/2012 12:52 PM, Andrew Cooper wrote: >>> This will allow userspace to reason with the total number of CPUs, not >>> just the current number of online CPUs. >>> >>> -- Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer T: +44 (0)1223 225 >>> 900, http://www.citrix.com >>> >>> xl-info-max_cpu_id.patch >>> >>> >>> # HG changeset patch >>> # Parent 5d20d2f6ffed0a49f030f04a8870f1926babbcbf >>> xl: display max_cpu_ids for xl info >>> >>> Expose "max_cpu_id" in stdout from `xl info` >>> >>> Signed-off-by: Andrew Cooper >>> >>> diff -r 5d20d2f6ffed tools/libxl/xl_cmdimpl.c >>> --- a/tools/libxl/xl_cmdimpl.c >>> +++ b/tools/libxl/xl_cmdimpl.c >>> @@ -3734,6 +3734,7 @@ static void output_physinfo(void) >>> } >>> >>> printf("nr_cpus : %d\n", info.nr_cpus); >>> + printf("max_cpu_id : %d\n", info.max_cpu_id); >> >> 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 > >> >>> printf("nr_nodes : %d\n", info.nr_nodes); >>> printf("cores_per_socket : %d\n", info.cores_per_socket); >>> printf("threads_per_core : %d\n", info.threads_per_core); >>> >>> >>> _______________________________________________ >>> Xen-devel mailing list >>> Xen-devel@lists.xen.org >>> http://lists.xen.org/xen-devel >> > > -- > Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer > T: +44 (0)1223 225 900, http://www.citrix.com --------------080103060309000701050900 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 03/14/2012 06:45 AM, Andrew Cooper wrote:
On 13/03/12 19:15, Zhigang Wang wrote:
On 03/13/2012 12:52 PM, Andrew Cooper wrote:
This will allow userspace to reason with the total number of CPUs, not
just the current number of online CPUs.

-- Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer T: +44 (0)1223 225 900, http://www.citrix.com

xl-info-max_cpu_id.patch

# HG changeset patch
# Parent 5d20d2f6ffed0a49f030f04a8870f1926babbcbf
xl: display max_cpu_ids for xl info

Expose "max_cpu_id" in stdout from `xl info`

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 5d20d2f6ffed tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3734,6 +3734,7 @@ static void output_physinfo(void)
     }
 
     printf("nr_cpus                : %d\n", info.nr_cpus);
+    printf("max_cpu_id             : %d\n", info.max_cpu_id);

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



     printf("nr_nodes               : %d\n", info.nr_nodes);
     printf("cores_per_socket       : %d\n", info.cores_per_socket);
     printf("threads_per_core       : %d\n", info.threads_per_core);


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

--------------080103060309000701050900-- --===============0985157212367887099== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============0985157212367887099==--