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?

Jeremy Fitzhardinge wrote:
> Gerd Hoffmann wrote:
>> Unmapping the grants when the kernel is about to zap the page range.
>> I think it could be easier because I don't have to link the low-level
>> paravirt code with the gntdev driver then.  Also I can easily batch
>> unmaps.  And there is a performance hit for the extra checks only for
>> processes which actually use grants.
>>   
> 
> 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.

>> 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?

cheers,
  Gerd

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

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