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

Re: [Xen-devel] Re: [PATCH] Add hypercall to mark superpages to improve

To: Dave McCracken <dcm@xxxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH] Add hypercall to mark superpages to improve performance
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Mon, 3 May 2010 17:29:14 +0100
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Xen Developers List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 03 May 2010 09:30:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C804B3BF.1309E%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: AcrqY+neLe2P2PbORqmHQq60FQTuzQAdxJsMAACyESg=
Thread-topic: [Xen-devel] Re: [PATCH] Add hypercall to mark superpages to improve performance
User-agent: Microsoft-Entourage/12.24.0.100205
On 03/05/2010 17:09, "Keir Fraser" <keir.fraser@xxxxxxxxxxxxx> wrote:

>> It should be simple enough to also check superpage->count_info in those
>> places.  So the total mappings of a page would be page->count_info +
>> superpage->count_info.  Good thing you suggested we also have a count in the
>> superpage_info struct :)
> 
> I think you're going to have trouble handling two separate reference counts,
> for superpages and single pages, in a race-free manner that is any better
> than checking/updating reference counts across all pages in a superpage on
> first superpage mapping.

For example: When making first superpage mapping, how do you know that all
pages belong to the relevant domain, without scanning every page_info? When
destructing last superpage mapping (or single-page mapping) how do you
safely check the 'other' reference count to decide whether the page is
freeable, without having races (last single-page and superpage mappings
could be destructed concurrently, need to ensure any given page gets freed
exactly once). And I could think of others no doubt... Just pointing out how
careful you have to be if you think you can avoid the naïve
refcount-updatign algorithms I suggested. I'd rather shoot down the obvious
races before you do the coding.

 -- Keir



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