xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Isaku Yamahata <yamahata@valinux.co.jp>,
	xen-devel@lists.xensource.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH 3/6] xen-gntdev: Remove unneeded structures from	grant_map tracking data
Date: Tue, 14 Dec 2010 13:54:55 -0800	[thread overview]
Message-ID: <4D07E7AF.7000101@goop.org> (raw)
In-Reply-To: <1292338553-20575-4-git-send-email-dgdegra@tycho.nsa.gov>

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

  parent reply	other threads:[~2010-12-14 21:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14 14:55 [PATCH v2] Userspace grant communication Daniel De Graaf
2010-12-14 14:55 ` [PATCH 1/6] xen-gntdev: Fix circular locking dependency Daniel De Graaf
2010-12-14 21:11   ` Jeremy Fitzhardinge
2010-12-14 21:40     ` Daniel De Graaf
2010-12-15  9:47       ` Ian Campbell
2010-12-16  0:28         ` Jeremy Fitzhardinge
2010-12-16 15:09           ` Stefano Stabellini
2010-12-14 14:55 ` [PATCH 2/6] xen-gntdev: Change page limit to be global instead of per-open Daniel De Graaf
2010-12-14 21:12   ` Jeremy Fitzhardinge
2010-12-14 21:42     ` Daniel De Graaf
2010-12-15  9:50       ` Ian Campbell
2010-12-16  0:27         ` Jeremy Fitzhardinge
2010-12-14 14:55 ` [PATCH 3/6] xen-gntdev: Remove unneeded structures from grant_map tracking data Daniel De Graaf
2010-12-14 21:15   ` Jeremy Fitzhardinge
2010-12-14 21:52     ` Daniel De Graaf
2010-12-14 21:56       ` Jeremy Fitzhardinge
2010-12-14 21:54   ` Jeremy Fitzhardinge [this message]
2010-12-14 14:55 ` [PATCH 4/6] xen-gntdev: Use find_vma rather than iterating our vma list manually Daniel De Graaf
2010-12-14 21:20   ` Jeremy Fitzhardinge
2010-12-15  9:58     ` Ian Campbell
2010-12-16  0:29       ` Jeremy Fitzhardinge
2010-12-14 14:55 ` [PATCH 5/6] xen-gntalloc: Userspace grant allocation driver Daniel De Graaf
2010-12-14 21:42   ` Jeremy Fitzhardinge
2010-12-14 22:06     ` Daniel De Graaf
2010-12-14 22:40       ` Jeremy Fitzhardinge
2010-12-15 14:18         ` Daniel De Graaf
2010-12-16  1:05           ` Jeremy Fitzhardinge
2010-12-16 15:22             ` Daniel De Graaf
2010-12-16 19:14               ` Jeremy Fitzhardinge
2010-12-14 14:55 ` [PATCH 6/6] xen-gntdev: Introduce HVM version of gntdev Daniel De Graaf
2010-12-14 21:45   ` Jeremy Fitzhardinge
2010-12-14 22:27     ` Daniel De Graaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D07E7AF.7000101@goop.org \
    --to=jeremy@goop.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=xen-devel@lists.xensource.com \
    --cc=yamahata@valinux.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).