All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jiang, Yunhong" <yunhong.jiang@intel.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>,
	Jeremy Fitzhardinge <jeremy@goop.org>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: RE: [PATCH] Add hypercall to expose physical CPU in xen hypervisor
Date: Sun, 8 Nov 2009 09:59:45 +0800	[thread overview]
Message-ID: <E2263E4A5B2284449EEBD0AAB751098418E4775CF9@PDSMSX501.ccr.corp.intel.com> (raw)
In-Reply-To: <C719FFAD.19683%keir.fraser@eu.citrix.com>

This patch 

Keir Fraser wrote:
> On 06/11/2009 08:20, "Jiang, Yunhong" <yunhong.jiang@intel.com> 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

  reply	other threads:[~2009-11-08  1:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-06  8:20 [PATCH] Add hypercall to expose physical CPU in xen hypervisor Jiang, Yunhong
2009-11-06 16:30 ` Keir Fraser
2009-11-08  1:59   ` Jiang, Yunhong [this message]
2009-11-08  7:46     ` Keir Fraser
2009-11-09  0:45       ` Jiang, Yunhong
2009-11-09 22:03       ` Jeremy Fitzhardinge
2009-11-10 12:16         ` Jiang, Yunhong
2009-11-10 16:36           ` Konrad Rzeszutek Wilk
2009-11-10 18:00             ` Jeremy Fitzhardinge
2009-11-10 12:02       ` Jiang, Yunhong

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=E2263E4A5B2284449EEBD0AAB751098418E4775CF9@PDSMSX501.ccr.corp.intel.com \
    --to=yunhong.jiang@intel.com \
    --cc=jeremy@goop.org \
    --cc=keir.fraser@eu.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 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.