* xl: expose max_cpu_id from `xl info`
@ 2012-03-13 16:52 Andrew Cooper
2012-03-13 19:15 ` Zhigang Wang
2012-03-14 11:10 ` Ian Jackson
0 siblings, 2 replies; 7+ messages in thread
From: Andrew Cooper @ 2012-03-13 16:52 UTC (permalink / raw)
To: xen-devel, Ian Jackson
[-- Attachment #1: Type: text/plain, Size: 218 bytes --]
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
[-- Attachment #2: xl-info-max_cpu_id.patch --]
[-- Type: text/x-patch, Size: 707 bytes --]
# 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);
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);
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: xl: expose max_cpu_id from `xl info`
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 11:10 ` Ian Jackson
1 sibling, 1 reply; 7+ messages in thread
From: Zhigang Wang @ 2012-03-13 19:15 UTC (permalink / raw)
To: Andrew Cooper; +Cc: xen-devel, Ian Jackson
[-- Attachment #1.1: Type: text/plain, Size: 1236 bytes --]
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
> 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
[-- Attachment #1.2: Type: text/html, Size: 2985 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: xl: expose max_cpu_id from `xl info`
2012-03-13 19:15 ` Zhigang Wang
@ 2012-03-14 10:45 ` Andrew Cooper
2012-03-14 15:48 ` Zhigang Wang
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cooper @ 2012-03-14 10:45 UTC (permalink / raw)
To: Zhigang Wang; +Cc: xen-devel, Ian Jackson
[-- Attachment #1.1: Type: text/plain, Size: 1638 bytes --]
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
>
>> 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: 3935 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: xl: expose max_cpu_id from `xl info`
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 11:10 ` Ian Jackson
1 sibling, 0 replies; 7+ messages in thread
From: Ian Jackson @ 2012-03-14 11:10 UTC (permalink / raw)
To: Andrew Cooper; +Cc: xen-devel
Andrew Cooper writes ("[Xen-devel] xl: expose max_cpu_id from `xl info`"):
> xl: display max_cpu_ids for xl info
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: xl: expose max_cpu_id from `xl info`
2012-03-14 10:45 ` Andrew Cooper
@ 2012-03-14 15:48 ` Zhigang Wang
2012-03-14 16:24 ` Andrew Cooper
0 siblings, 1 reply; 7+ messages in thread
From: Zhigang Wang @ 2012-03-14 15:48 UTC (permalink / raw)
To: Andrew Cooper; +Cc: xen-devel, Ian Jackson
[-- 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: xl: expose max_cpu_id from `xl info`
2012-03-14 15:48 ` Zhigang Wang
@ 2012-03-14 16:24 ` Andrew Cooper
2012-03-14 17:51 ` Zhigang Wang
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cooper @ 2012-03-14 16:24 UTC (permalink / raw)
To: Zhigang Wang; +Cc: xen-devel, Ian Jackson
<snip>
>>> 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.
--
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: xl: expose max_cpu_id from `xl info`
2012-03-14 16:24 ` Andrew Cooper
@ 2012-03-14 17:51 ` Zhigang Wang
0 siblings, 0 replies; 7+ messages in thread
From: Zhigang Wang @ 2012-03-14 17:51 UTC (permalink / raw)
To: Andrew Cooper; +Cc: xen-devel, Ian Jackson
On 03/14/2012 12:24 PM, Andrew Cooper wrote:
> <snip>
>>>> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-03-14 17:51 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-03-14 16:24 ` Andrew Cooper
2012-03-14 17:51 ` Zhigang Wang
2012-03-14 11:10 ` Ian Jackson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.