xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Zhigang Wang <zhigang.x.wang@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: xl: expose max_cpu_id from `xl info`
Date: Wed, 14 Mar 2012 11:48:10 -0400	[thread overview]
Message-ID: <4F60BDBA.3040209@oracle.com> (raw)
In-Reply-To: <4F6076D1.3000804@citrix.com>


[-- Attachment #1.1: Type: text/plain, Size: 1920 bytes --]

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


[-- Attachment #1.2: Type: text/html, Size: 4543 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2012-03-14 15:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 16:52 xl: expose max_cpu_id from `xl info` Andrew Cooper
2012-03-13 19:15 ` Zhigang Wang
2012-03-14 10:45   ` Andrew Cooper
2012-03-14 15:48     ` Zhigang Wang [this message]
2012-03-14 16:24       ` Andrew Cooper
2012-03-14 17:51         ` Zhigang Wang
2012-03-14 11:10 ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F60BDBA.3040209@oracle.com \
    --to=zhigang.x.wang@oracle.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).