From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Andrea Arcangeli <andrea@qumranet.com>
Cc: Mark McLoughlin <markmc@redhat.com>,
xen-devel <xen-devel@lists.xensource.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Michael Abd-El-Malek <mabdelmalek@cmu.edu>,
Keir Fraser <keir.fraser@eu.citrix.com>,
Christoph Lameter <clameter@sgi.com>
Subject: Re: Vanilla Linux and has_foreign_mapping
Date: Fri, 25 Apr 2008 17:14:03 -0700 [thread overview]
Message-ID: <481273CB.4070109@goop.org> (raw)
In-Reply-To: <20080425172416.GC23300@duo.random>
Andrea Arcangeli wrote:
> Hello everyone,
>
> On Fri, Apr 25, 2008 at 01:11:28PM -0400, Michael Abd-El-Malek wrote:
>
>> - /* mm's last user has gone, and its about to be pulled down */
>> - arch_exit_mmap(mm);
>> -
>> lru_add_drain();
>> flush_cache_mm(mm);
>> tlb = tlb_gather_mmu(mm, 1);
>> /* Don't update_hiwater_rss(mm) here, do_exit already did */
>> /* Use -1 here to ensure all VMAs in the mm are unmapped */
>> end = unmap_vmas(&tlb, vma, 0, -1, &nr_accounted, NULL);
>> + /* mm's last user has gone, and its about to be pulled down */
>> + arch_exit_mmap(mm);
>>
>
> If that's what you need I doubt mmu notifiers can help. mmu notifiers
> allows to keep secondary mmu mappings (like vmx/svm/npt/ept sptes) in
> total synchrony with the primary mmu mappings established by the linux
> VM. All secondary mmu mappings must be zapped and the secondary mmu
> must be freezed before the pages are freed, hence the last mmu
> notifier call is ->release and it's done _before_ the above
> unmap_vmas.
>
For Xen, arch_exit_mmap() needs to be done before unmap_vmas since the
whole point is to switch to init_mm before tearing down the pagetable to
avoid lots of hypercalls. The trouble is that mappings of foreign pages
need to be dealt with specially because Xen requires that they be
unmapped with a special mechanism.
What I was wondering if, rather than getting a callback, we could call
into the mmu notifier machinery to get a list of mapped foreign pages
and their corresponding pte pointers so that they can be "manually"
unmapped early in Xen's arch_exit_mmap().
On the other hand, I think we can just hang a shadow page off the pte
page's struct page to store all the extra metadata we need...
J
prev parent reply other threads:[~2008-04-26 0:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-20 21:19 Vanilla Linux and has_foreign_mapping Michael Abd-El-Malek
2008-04-21 11:46 ` Jeremy Fitzhardinge
2008-04-21 16:36 ` Mark McLoughlin
2008-04-21 18:00 ` Michael Abd-El-Malek
2008-04-21 17:52 ` Keir Fraser
2008-04-21 18:10 ` Michael Abd-El-Malek
2008-04-21 18:17 ` Michael Abd-El-Malek
2008-04-21 18:30 ` Keir Fraser
2008-04-25 0:18 ` Jeremy Fitzhardinge
2008-04-25 6:01 ` Keir Fraser
2008-04-25 17:11 ` Michael Abd-El-Malek
2008-04-25 18:22 ` Jeremy Fitzhardinge
2008-04-25 18:31 ` Michael Abd-El-Malek
2008-04-25 22:33 ` Jeremy Fitzhardinge
2008-04-29 16:39 ` Michael Abd-El-Malek
2008-04-29 17:32 ` Jeremy Fitzhardinge
2008-04-30 16:31 ` Michael Abd-El-Malek
[not found] ` <20080425172416.GC23300@duo.random>
2008-04-26 0:14 ` Jeremy Fitzhardinge [this message]
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=481273CB.4070109@goop.org \
--to=jeremy@goop.org \
--cc=andrea@qumranet.com \
--cc=clameter@sgi.com \
--cc=ehabkost@redhat.com \
--cc=keir.fraser@eu.citrix.com \
--cc=mabdelmalek@cmu.edu \
--cc=markmc@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.