All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Xen Development Mailing List <xen-devel@lists.xensource.com>
Subject: Re: pv_ops & gntdev?
Date: Wed, 25 Feb 2009 14:59:35 -0800	[thread overview]
Message-ID: <49A5CD57.2010300@goop.org> (raw)
In-Reply-To: <49A5C957.7060205@redhat.com>

Gerd Hoffmann wrote:
>> Would the unmap operation on the vma be enough to do that?   Hm, I guess
>> vm_operations_struct needs something that gets called before the zap
>> rather than after (->close).
>>     
>
> mmu motifier will fit the bill and additionally work fine on partial unmaps.
>   

OK, it'll be interesting to see how that turns out.

>>> The (unclean) exit case might be tricky though.  Could be the kernel
>>> tries to unpin before zapping all mappings, so we don't trap into xen
>>> all the time.
>>>       
>> Yes, the unpin needs to make sure it clears out all the grant refs,
>> because you just can't unpin otherwise.
>>
>> The alternative is to hook into the fault handler so that a
>> fault-n-emulate operation on the pagetable which fails because of the
>> grant reference can be fixed up at that point.  But that might be even
>> more intrusive.
>>     
>
> Or just allow to flag "skip the unpin please for this mm".  It's an
> optimization after all, it isn't required, right?
>   

If its pinned you have to unpin; you can't free pagetable pages while 
they're pinned.  If you don't pin the pagetable then context switches 
get very slow (it would need to revalidate the whole pagetable every 
context switch).

We could, however, defer the unpin and unpin late, after all the vmas 
have been unmapped.  But that's a bit ugly (it would require a separate 
hook in exit_mmap).

    J

  reply	other threads:[~2009-02-25 22:59 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24 18:45 pv_ops & gntdev? Gerd Hoffmann
2009-02-24 21:18 ` Jeremy Fitzhardinge
2009-02-24 22:12   ` Gerd Hoffmann
2009-02-25 10:05     ` Gerd Hoffmann
2009-02-25 17:51       ` Jeremy Fitzhardinge
2009-02-25 18:37         ` Gerd Hoffmann
2009-02-25 20:06           ` Jeremy Fitzhardinge
2009-02-25 21:19             ` Gerd Hoffmann
2009-02-25 21:35               ` Jeremy Fitzhardinge
2009-02-25 21:43                 ` Gerd Hoffmann
2009-02-25 21:48                   ` Jeremy Fitzhardinge
2009-02-25 22:11                     ` Gerd Hoffmann
2009-02-25 22:28                       ` Jeremy Fitzhardinge
2009-02-25 22:42                         ` Gerd Hoffmann
2009-02-25 22:59                           ` Jeremy Fitzhardinge [this message]
2009-03-02 22:53                             ` Gerd Hoffmann
2009-03-03  1:05                               ` Jeremy Fitzhardinge
2009-03-03 22:59                               ` Jeremy Fitzhardinge
2009-03-04  8:18                                 ` Gerd Hoffmann
2009-03-04 14:52                                   ` Gerd Hoffmann
2009-03-04 15:16                                     ` Jeremy Fitzhardinge
2009-03-04 15:32                                       ` Gerd Hoffmann
2009-02-25 18:56         ` Gerd Hoffmann
2009-02-25 20:10           ` Jeremy Fitzhardinge
2009-02-25 21:45             ` Gerd Hoffmann
2009-02-25 22:16             ` Gerd Hoffmann
2009-02-25 22:30               ` Jeremy Fitzhardinge

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=49A5CD57.2010300@goop.org \
    --to=jeremy@goop.org \
    --cc=kraxel@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.