mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: <xen-devel@lists.xen.org>, <linux-kernel@vger.kernel.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Xen-devel] [PATCH RFC] p2m: use GNTTABOP_unmap_and_duplicate if	available
Date: Thu, 1 Aug 2013 10:53:47 +0100	[thread overview]
Message-ID: <51FA302B.90106@citrix.com> (raw)
In-Reply-To: <1375286855-4861-1-git-send-email-roger.pau@citrix.com>

On 31/07/13 17:07, Roger Pau Monne wrote:
> The new GNTTABOP_unmap_and_duplicate operation doesn't zero the
> mapping passed in new_addr, allowing us to perform batch unmaps in p2m
> code without requiring the use of a multicall.

Thanks. This looks like it should be a good performance improvement for
userspace-based backends.  Do you have any performance measurements for
(e.g.) qemu's disk backend?

> --- a/arch/x86/xen/p2m.c
> +++ b/arch/x86/xen/p2m.c
[...]
> +int m2p_remove_override_batch(struct page **pages,
> +		struct gnttab_map_grant_ref *kmap_ops, int count)
> +{

Is it possible to refactor this function and
m2p_remove_override_single() to share some common helper functions?

> +	struct gnttab_unmap_and_duplicate *unmap_ops = NULL;
> +	unsigned long *mfn = kcalloc(count, sizeof(mfn[0]), GFP_KERNEL);
> +	unsigned long flags;
> +	unsigned long pfn;
> +	unsigned long uninitialized_var(address);
> +	unsigned level;
> +	struct page *page;
> +	pte_t *ptep = NULL;
> +	int ret = 0, i;
> +
> +
> +	for (i = 0; i < count; i++) {
> +		page = pages[i];
> +		pfn = page_to_pfn(page);

The bits in this loop...

[...]
> +	for (i = 0; i < count; i++) {
> +		/* p2m(m2p(mfn)) == FOREIGN_FRAME(mfn): the mfn is already present
> +		 * somewhere in this domain, even before being added to the

... and this one look they should be common between the two.

David

  reply	other threads:[~2013-08-01  9:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 16:07 Roger Pau Monne
2013-08-01  9:53 ` David Vrabel [this message]
2013-08-01 10:21   ` [Xen-devel] " Roger Pau Monné

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=51FA302B.90106@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roger.pau@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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

Powered by JetHome