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] more profiling

To: "Santos, Jose Renato G" <joserenato.santos@xxxxxx>, "Andy Grover" <andy.grover@xxxxxxxxxx>
Subject: RE: [Xen-devel] more profiling
From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
Date: Sat, 1 Mar 2008 09:25:42 +1100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 29 Feb 2008 14:26:06 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C7B67062D31B9E459128006BAAD0DC3D0753CEC544@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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: <AEC6C66638C05B468B556EA548C1A77D0131AF31@trantor> <AEC6C66638C05B468B556EA548C1A77D0131AF34@trantor> <C7B67062D31B9E459128006BAAD0DC3D0753CEC544@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Ach6wj+maafveOiCSzitY54bCV1UyQAFngGQAAfOF9AACjpIIA==
Thread-topic: [Xen-devel] more profiling
> James,
> 
> Could you please provide me some context and details of this work.
> This seems related to the work we are doing in netchannel2 to reuse
> grants, but I don't think I understand what is that you are trying to
do
> and how it is related.
> 

The solution I ended up implementing was to keep a list of pre-allocated
pre-granted pages. Any time we need a new page (either for putting on
the rx list, or for copying a tx packet to) it comes from the list. If
there are no page on the list, a new page is allocated and granted. When
we are finished with the page, it goes back on the free list.

I'll also be writing some sort of garbage collector which runs
periodically (maybe every x seconds, or every x calls to
'put_page_on_freelist'). If during that interval the number of free
pages has been constantly above some threshold (32?), then we will
ungrant and free half the pages on the list. This will keep memory usage
reasonable while keeping performance good.

In the tx path, the windows xennet driver currently takes the sg list of
buffers per packet and copies them to a single page buffer. At first I
thought there would be some performance to be had in just passing the
backend the list of pages, but it looks like the memory copy operation
is much less expensive than the grant operation.

James


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

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