WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [Question] vcpu-set before or after xen_pause_requested

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [Question] vcpu-set before or after xen_pause_requested
From: "Liu, Jinsong" <jinsong.liu@xxxxxxxxx>
Date: Tue, 20 Apr 2010 17:43:36 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "ian.campbell@xxxxxxxxxx" <ian.campbell@xxxxxxxxxx>, "Zhai, Edwin" <edwin.zhai@xxxxxxxxx>, "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>, "alex.nixon@xxxxxxxxxx" <alex.nixon@xxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Tue, 20 Apr 2010 02:49:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19404.31543.186398.77423@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <EB8593BCECAB3D40A8248BE0B6400A38469C6F70@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <19399.7706.36343.487108@xxxxxxxxxxxxxxxxxxxxxxxx> <BC00F5384FCFC9499AF06F92E8B78A9E026FAC6041@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <19404.31543.186398.77423@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acrf18O1s8NF4maRRiOqNPwq7G0eGQAidORw
Thread-topic: [Xen-devel] [Question] vcpu-set before or after xen_pause_requested
Ian Jackson wrote:
> Liu, Jinsong writes ("RE: [Xen-devel] [Question] vcpu-set before or
> after xen_pause_requested"): ...
>> We keep same (HVM) xm command --> xend server --> xenstore path as
>> PV domain. At /local/domain/(domid)/cpu, we setup vcpu watch and
>> handle at qemu side.
> 
> I've looked at your patch 2 and it's not correct because there is no
> acknowledgement back to the utility which changes xenstore.  You have
> to close the loop, if for no other reason than if there are two
> xenstore changes in a row which the receiving qemu-dm only gets around
> to dealing with after the second, it will see only the second value.

I think no problem here. In our test of the patch, 16 xenstore changes in row 
(vcpu0~15), and it trigger 16 event.

> 
> How does the PV vcpu protocol deal with this ?  Doesn't a PV guest
> find out about VCPU changes from Xen ?

'xm vcpu-set' command works for PV now. Nixon and Campbell implement vcpu-set 
PV dirver at drivers/xen/cpu_hotplug.c. CC them :)

> 

Ian, 

I noticed that qemu watch xenstore nodes and handle event in a close-loop way, 
like, usb-add/usb-del watch '/local/domain/0/device-model/domid/command' node 
and response xenstore with 'usb-added' / 'usb-deleted'. 
It's one way to communicate between xenstore and qemu.

However, is it the only way to communicate between qemu/xenstore, or between 
PV/xenstore?
I check 'xm vcpu-set' command path, it now works for PV domain in an open-loop 
way:
1). PV register a xenbus_watch
        static struct xenbus_watch cpu_watch = {
                .node = "cpu",
                .callback = handle_vcpu_hotplug_event};

        (void)register_xenbus_watch(&cpu_watch);
2). when xend write xenstore cpu node or its sub-level nodes, it trigger 
callback function handle_vcpu_hotplug_event(), then xenbus_scanf() / 
xenbus_read() ...

Before we implement our current patch, in fact we have 2 choices:
    A). keep same HVM 'xm command --> xend --> xenstore' path with PV, qemu 
watch '/local/domain/domid/cpu', trigger callback function in open-loop way 
(also similar as PV). The advantage is we have unify 'xm command --> xend --> 
xenstore' path for both PV and HVM.
    B). qemu work in close-loop way, like 'usb-add' and 'usb-del' command. The 
disadvantage is, we need add an hvm path at 'xm command --> xend --> xenstore', 
so there are 2 path for 'xm vcpu-set' command, 1 for PV and 1 for HVM. It's not 
beautiful. BTW, since vcpu-set need watch different xenstore node with 
'usb-add''usb-del', we cannot re-use 'usb' path or function like 
signalDeviceModel(). It need add more code to 'xm command --> xend --> 
xendstore'.

Current our patch use scheme A). However, I think scheme B) also can work fine. 
It depend on you and let me know your decision :)


Thanks,
Jinsong
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel