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

xen-devel

[Top] [All Lists]

Re: [Xen-devel] Hi,something about the xentrace tool

To: George Dunlap <dunlapg@xxxxxxxxx>
Subject: Re: [Xen-devel] Hi,something about the xentrace tool
From: Rob Gardner <rob.gardner@xxxxxx>
Date: 2006年6月18日 23:00:53 -0600
Cc: xen-tools@xxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, xen-users@xxxxxxxxxxxxxxxxxxx, rickey berkeley <rickey.berkeley@xxxxxxxxx>
Delivery-date: 2006年6月18日 22:01:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <de76405a0606181806y4d08998ua680342c561be6d0@xxxxxxxxxxxxxx>
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>
References: <A95E2296287EAD4EB592B5DEEFCE0E9D4BAAAA@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <8061f8830606150158m35f11025t43c3fa962ccd6679@xxxxxxxxxxxxxx> <449192E1.4080808@xxxxxx> <de76405a0606151120m5f333609s126bda4d33e73ef@xxxxxxxxxxxxxx> <4491AC9A.2090906@xxxxxx> <de76405a0606181806y4d08998ua680342c561be6d0@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)
George Dunlap wrote:
There's no copying from the HV to the xentrace process. But there is
copying from xentrace to the dom0 kernel for the output file. Some
copying is necessary right now, because rather than writing out the
pages verbatim, xentrace writes out the pcpu before writing out each
record:
void write_rec(unsigned int cpu, struct t_rec *rec, FILE *out)
{
 size_t written = 0;
 written += fwrite(&cpu, sizeof(cpu), 1, out);
 written += fwrite(rec, sizeof(*rec), 1, out);
 if ( written != 2 )
 {
 PERROR("Failed to write trace record");
 exit(EXIT_FAILURE);
 }
}
If we wanted to make it zero copy all the way from the HV to the disk,
we could have the xentrace process one stream per cpu, and do
whatever's necessary to use DMA. (Does anyone know if O_DIRECT will
do direct DMA, or if one would have to use a raw disk?)
So you're saying if we didn't have to write the cpu number, then we could bypass stdio, and directly do a write() using the trace buffer? And this would be better because it would avoid a memory to memory copy, and use DMA immediately on the trace buffer memory? Do I understand you correctly? Assuming this is what you mean, allow me to correct a slight logic flaw. Stdio is there for a reason; Doing lots of raw I/O using very small buffers is highly inefficient. There's the overhead of kernel entry/exit and of setting up and tearing down DMA transactions. And writing to a block device will result in I/O's that are multiples of the devices' block size, so writing a 32 byte trace record will probably cause a 512-byte block to actually be written to disk. So bypassing stdio in this case will result in lots more disk accesses, lots more dma setup/teardown, and lots more system calls. In other words, the performance is going to horrible. The Stdio library greatly reduces all this overhead by buffering stuff in memory until there's enough to make a genuine I/O relatively efficient. In this case, the memory copies are intentional and beneficial; We do not want to eliminate them in our quest for "zero copy".
Rob
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
Previous by Date: Re: [Xen-devel] [PATCH] [RFC] Domain name issue , Masaki Kanno
Next by Date: [Xen-devel][Patch] Enable PAE VMX guest on PAE host , Xin, Xiaohui
Previous by Thread: Re: [Xen-devel] Hi,something about the xentrace tool , George Dunlap
Next by Thread: Re: [Xen-devel] Hi,something about the xentrace tool , George Dunlap
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /