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: [PATCH] Add hypercall to mark superpages to improve perf

To: Dave McCracken <dcm@xxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] Add hypercall to mark superpages to improve performance
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Fri, 30 Apr 2010 15:10:30 -0700
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Xen Developers List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 30 Apr 2010 15:22:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C80099F3.1198F%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcronZePAP0nxKFhQeKdK+VxyQ9jrQADriV7AAFodVQ=
Thread-topic: [PATCH] Add hypercall to mark superpages to improve performance
User-agent: Microsoft-Entourage/12.23.0.091001
On 30/04/2010 14:30, "Keir Fraser" <keir.fraser@xxxxxxxxxxxxx> wrote:

>>> Secondly, I don't really believe that the mark/unmark
>>> hypercalls are race-free -- bearing in mind, that other mappings (superpage
>>> or otherwise) can be constructed or deleted in parallel on other cpus.
>> 
>> I'll look into what can be done to prevent races.  I suspect some races we
>> don't care about.
> 
> I mean I think there are probably races that can result in inconsistent
> reference counts. I reckon I'll be able to find some when I'm back from
> travelling next week. Obviously, any such race would be unacceptable.

Here's one that's not even really a race: what if a guest marks a superpage
(via hypercall), then creates a mapping of that superpage, then creates
single-page mappings of all pages in the superpage except the first, then
unmarks the superpage? All refcounts of pages in the superpage will be the
same (because the first page holds the superpage mapping count, and all
other pages have a count from their respectibve single-page mappings). So
unmark would succeed, but now destroying the superpage mapping will
erroneously decrement the refcount of every page in the superpage?

 -- Keir



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