From: Jeremy Fitzhardinge <jeremy@goop.org>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xensource.com,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 0/6] xen: don't call vmalloc_sync_all() when mapping foreign pages
Date: Thu, 15 Sep 2011 14:37:27 -0700 [thread overview]
Message-ID: <4E727017.4030001@goop.org> (raw)
In-Reply-To: <1316090411-22608-1-git-send-email-david.vrabel@citrix.com>
On 09/15/2011 05:40 AM, David Vrabel wrote:
> This set of pages avoids the need to call vmalloc_sync_all() when
> mapping foreign pages. Two new functions are adding for mapping
> foreign pages onto RAM pages instead of vmalloc space.
>
> This does waste a page of RAM for each mapped page. In the future a
> ballooned page could be used instead (once the API for getting a
> ballooned page with the right GFP flags is available).
You can allocate a pfn, free ("balloon out") the underlying mfn, and
replace it with a granted page; it doesn't need any particular new
infrastructure.
But that said, if you want to allocate virtual addresses for mapping
granted pages, then alloc_vm_area() is the right thing to use. You need
to make sure you touch the pages from within the kernel before passing
those addresses to a hypercall to make sure the mappings are established
within the current task (possibly within a no-preempt region to
guarantee that nothing odd happens). Or alternatively, you could switch
the current pagetable to init_mm for the hypercall (if it isn't already)
- since that's the reference pagetable - assuming you're not passing
usermode virtual addresses to the hypercall.
This series is relying on regular ram mappings are already synced to all
tasks, but I'm not sure that's necessarily guaranteed (for example, if
you hotplug new memory into the domain, the new pages won't be mapped
into every mm unless they're synced).
J
next prev parent reply other threads:[~2011-09-15 21:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-15 12:40 [PATCH 0/6] xen: don't call vmalloc_sync_all() when mapping foreign pages David Vrabel
2011-09-15 12:40 ` [PATCH 1/6] xen: add functions for mapping foreign pages over pages David Vrabel
2011-09-15 12:40 ` [PATCH 2/6] block: xen-blkback: use API provided by xenbus module to map rings David Vrabel
2011-09-15 12:40 ` [PATCH 3/6] net: xen-netback: " David Vrabel
2011-09-15 12:40 ` [PATCH 4/6] xen: xen-pciback: use xenbus_map_ring_page() " David Vrabel
2011-09-15 12:40 ` [PATCH 5/6] xen: xenbus: remove xenbus_map_ring_valloc() and xenbus_map_ring_vfree() David Vrabel
2011-09-15 12:40 ` [PATCH 6/6] mm: remove vmalloc_sync_all() from alloc_vm_area() David Vrabel
2011-09-15 21:37 ` Jeremy Fitzhardinge [this message]
2011-09-21 10:42 ` [PATCH 0/6] xen: don't call vmalloc_sync_all() when mapping foreign pages Stefano Stabellini
2011-09-21 18:57 ` [Xen-devel] " Jeremy Fitzhardinge
2011-09-22 11:06 ` Stefano Stabellini
2011-09-22 21:19 ` Jeremy Fitzhardinge
2011-09-23 10:53 ` Stefano Stabellini
2011-09-23 11:18 ` David Vrabel
2011-09-21 14:44 ` David Vrabel
2011-09-23 15:11 ` David Vrabel
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=4E727017.4030001@goop.org \
--to=jeremy@goop.org \
--cc=akpm@linux-foundation.org \
--cc=david.vrabel@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xensource.com \
/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