WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: pv_ops & gntdev?

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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>