[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] RE: [PATCH] Add hypercall to expose physical CPU in xen hypervisor



This patch 

Keir Fraser wrote:
> On 06/11/2009 08:20, "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx> wrote:
> 
>> This patch add hypercall to xen hypervisor to expose physical CPU
>> information. It also make some changes to current cpu online/offline
>> logic: 1) Firstly, cpu online/offline will trigger a vIRQ to dom0
>> for status changes notification. 2) It also add an interface to
>> platform operation to online/offline physical CPU. Currently the cpu
>> online/offline interface is in sysctl, which can't be triggered in
>> kernel. With this change, it is possible to trigger cpu
>> online/offline in dom0 through sysfs interface. 
> 
> Is this and the accompanying Linux patch something that people
> really want?

The Linux patch is initially part of patch for CPU hotplug. As stated when 
discussion with Jeremy before 
(http://lists.xensource.com/archives/html/xen-devel/2009-09/msg01111.html), we 
decided to take two step method for CPU hot-add. The first step, xen will set 
the CPU as present after get notification from dom0, in the second step, Xen 
will set the CPU online and put it to schedule. Through the sysfs interface, 
the step 2 is quite easy, simple echo "1" to an xen_pcpu entry in sysfs, which 
can be used by udev rules easily.

I assume Jeremy have agreed for the interface in sysfs for pcpu , as he stated 
"Yes, that makes sense.  Would it eventually be worth mirroring the normal cpu 
heirarchy as much as possible to add an interface for stats and power 
management?" in 
http://lists.xensource.com/archives/html/xen-devel/2009-09/msg01079.html. 

When I split the original CPU hotplug patch according to Jeremy's suggestion, I 
think this part is not related to CPU hotplug so much and in fact can be 
generalized.  The issue of this method is, the sysfs interface is async, so the 
tools may miss latest change. I assume it should be accptable since even with 
directly hypercall , the information may be changed still.

As for usefulness of the patch, I'd get more input from community. For Linux 
kernel patch, an central sysfs entry will be helpful IMO. 
For the hypercall patch, currently there are several methods to expose the 
physical CPU information to administrative tools or dom0, at least including: 
XEN_SYSCTL_getcpuinfo, XEN_SYSCTL_pm_op_get_cputopo, XEN_MC_physcpuinfo (The 
XEN_MC_physcpuinfo includes MCA information also), but none of them can meet my 
requirement, and none of them can be extended easily, so I have to create a new 
one. I tihnk if there is a central hypercall to provide all physical CPU 
information, it will be helpful.  

BTW, I really can't tell why XEN_SYSCTL_getcpuinfo will only provide idle_time 
while comments stated as "Get physical CPU information".

> 
> The new platform hypercall will never be changeable for compatibility
> reasons and looks kinda... arbitrary.

Yes, current interface is not flexible, and is only for CPU hotplug support. If 
needed and agreed, I'd happy to extent it as a general interface to fetch 
physical CPU information, including: 
1) Basic information like vendor/model/capability
2) Topo info, like initial APIC ID, the cores_per_package, thread_per_core etc.
3) CPU stat information,like online stat, idle_time etc.

As for make it extensible, I'd have a version number and leave space for future 
extenstion, how about it?

Thanks
Yunhong Jiang

> 
> Personally I'd rather not take it.
> 
> -- Keir
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.