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] [PATCH 3/6] xen-gntdev: Remove unneeded structures from

To: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 3/6] xen-gntdev: Remove unneeded structures from grant_map tracking data
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 14 Dec 2010 13:54:55 -0800
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Ian.Campbell@xxxxxxxxxx
Delivery-date: Tue, 14 Dec 2010 13:55:39 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1292338553-20575-4-git-send-email-dgdegra@xxxxxxxxxxxxx>
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: <1292338553-20575-1-git-send-email-dgdegra@xxxxxxxxxxxxx> <1292338553-20575-4-git-send-email-dgdegra@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.7
On 12/14/2010 06:55 AM, Daniel De Graaf wrote:
> -static int unmap_grant_pages(struct grant_map *map, int offset, int pages)
> +static void unmap_grant_pages(struct grant_map *map, int offset, int pages)
>  {
> -     int i, err = 0;
> +     int i, flags, err = 0;
> +     struct gnttab_unmap_grant_ref *unmap_ops;
> +     struct gnttab_unmap_grant_ref unmap_single;
> +
> +     if (pages > 1) {
> +             unmap_ops = kzalloc(sizeof(unmap_ops[0]) * pages,
> +                                 GFP_TEMPORARY);
> +             if (unlikely(!unmap_ops)) {
> +                     for(i=0; i < pages; i++)
> +                             unmap_grant_pages(map, offset + i, 1);
> +                     return;
> +             }
> +     } else {
> +             unmap_ops = &unmap_single;
> +     }

Rather than doing this, it would be better to use the multicall batching
API, in particular xen_mc_extend_args() - see xen_extend_mmu_update()
for an example.

(This would mean promoting arch/x86/xen/multicall.h to
include/xen/multicall.h and breaking ia64 builds until there's an ia64
implementation of that API, but that seems like a fair tradeoff at this
point.)

    J


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

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