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

[Xen-devel] RE: [PATCH] Xenoprof passive domain support

To: "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx>
Subject: [Xen-devel] RE: [PATCH] Xenoprof passive domain support
From: "Santos, Jose Renato G" <joserenato.santos@xxxxxx>
Date: Fri, 28 Apr 2006 18:43:09 -0700
Cc: Yoshio Turner <yoshiotu@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, G John Janakiraman <john@xxxxxxxxxxxxxxxxxxx>, John Levon <levon@xxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 28 Apr 2006 18:43:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcZqmZRc5gf3TmvrQzOeq5R5ZWQN8QAdZT7A
Thread-topic: [PATCH] Xenoprof passive domain support
Xiaowei,

Thanks for the patch.
I took a first look in the patch and have a few comments.

First, I think there is a concurrency problem that needs to
fixed. If dom0 has more than one VCPU, then 2 VCPUs can
access the same passive buffer at the same time. This
should not be allowed, since the buffer is not
protected by any lock. We should make sure that any
passive domain buffer is accessed by one and only one
dom0 VCPU. A simple approach would be to have only
VCPU 0 (in dom0) to handle all the passive domain
samples. However, this may cause an 
imbalance on the speed that oprofile CPU buffers are filled.
Probably the cpu buffer for VCPU 0 would fill much
earlier and cause more frequent flushes to the event buffer,
increasing the overhead.
I would prefer if we could distribute the passive
buffers to all VCPUs in dom0. I will think more about
this during the weekend and make additional comments,
earlier next week.

Second, I see that you reused most of the code that
was used in Xen 2.0, when passive domains was supported
for non SMP guests. 
John Levon (cc'ed on this message) has made some comments
on that code which I think we should address right now. 
More specifically, he suggested that we change the way
domain switches are represented in the CPU buffer. 
Please look at his comment below. 

I suggest that we address these 2 issues first and
then I can look more carefully at the rest of the code.
Please CC John Levon, on you next messages

Thanks

Renato

Old comments by John Levon on passive domain code:
=============================================================
I'm uncomfortable with the chosen domain switching encoding. It's pretty
confusing to follow all the escaping done already, and you're making it
more complicated. Why can't you use a normal ESCAPE_CODE? I.e. the
buffer would have

   EIP          Event
---------------------------------
0. ESCAPE_CODE  DOMAIN_SWITCH
1. domain ID
2. EIP          Event

Sure, you lose an entry (1) in size but it means simpler code, and less
i-cache hurt.

Why is the state not persistent until the next escape code? i.e. it's
only for one sample.

======================================================================
>> -----Original Message-----
>> From: Yang, Xiaowei [mailto:xiaowei.yang@xxxxxxxxx] 
>> Sent: Friday, April 28, 2006 12:59 AM
>> To: Santos, Jose Renato G
>> Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
>> Subject: [PATCH] Xenoprof passive domain support
>> 
>> Hi Renato,
>> This patch is to add Xenoprof passive domain support in SMP 
>> environment. Basically: 
>> - It allocates per vcpu buffers for passive domain and maps 
>> them into primary domain's space. 
>> - When primary domain gets sampled and triggers virq, its 
>> kernel module will handle passive domain' samples besides 
>> its owns. There is potential buffer overflow if passive is 
>> very busy while primary is idle. The simple workaround is to 
>> allocate a rather big buffer for passive. For now it works 
>> fine. A better way is to notify primary when passive buffer 
>> exceeds the threshold.
>> - When oprofile gets passive domain samples, it splits them 
>> in to 3 parts by PC ranges pre-definition: 
>> xen/kernel/application and maps the first two into 
>> functions. The oprofile version is a little old, for the 
>> patch was made last August. 
>> 
>> The main usage is to use Xenoprof to profile HVM domain as 
>> passive domain, which provides enough information for low 
>> level performance tuning while no change in HVM is needed.
>> 
>> Thanks,
>> Xiaowei
>> 

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

<Prev in Thread] Current Thread [Next in Thread>