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] copy on write memory

To: Jacob Gorm Hansen <jacobg@xxxxxxx>
Subject: Re: [Xen-devel] copy on write memory
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Fri, 19 Nov 2004 10:59:09 +0000
Cc: Peri Hankey <mpah@xxxxxxxxxxxxxx>, urmk@xxxxxxxxxxxxxxxxx, Rik van Riel <riel@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 19 Nov 2004 11:00:45 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
In-reply-to: Your message of "Fri, 19 Nov 2004 11:35:17 +0100." <419DCC65.4010704@xxxxxxx>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
This would end up pushing policy into Xen -- what happens when memory
is fully committed, some domain has given up a bunch of his
exclusively-owned pages by buying into the shared table, and now he
has a slew of CoW faults and wants to get some of his exclusive pages
back from Xen, thankyou very much?

At this point Xen needs some reclamation policy (saying that Xen will
guarantee to have enough pages around to satisfy these requests is not
possible, since the point of the sharing is to be able to
"over-reserve" memory). It needs to decide which pages to reclaim,
then have a mechanism for reclaiming them which will probably involve
communicating up to the domains concerned in advance and setting
timeouts by when they must relinquish their mappings.

This is the kind of thing I would prefer to implement outside Xen.

 -- Keir

> I would like to re-plug the idea I proposed earlier, on the topic of 
> sharing read-only pages across domains:
> 
> Create a new variant of the HYPERVISOR_update_va_mapping (or of the 
> batched variant, or both), lets call it HYPERVISOR_make_ro_and_share.
> 
> When Xen gets this hypercall, it does the following:
> 
> - Turn the mapping into a read-only mapping.
> 
> - Look up the contents of the machine page in the mapping in a 
> machine-global hash table or other suitable type of associative data 
> strucure.
> 
> - If there is a match, make the user's mapping point to the matching 
> page. Also increase a reference/sharing count of the matching page.
> 
> - If there is no match, insert the user's page into the hash table.
> 
> - Revoke the user's ownership of the old page.
> 
> If the mapping is write-accessed inside the user's domain, the user will 
> be responsible for CoWing the page into a newly allocated one. As an 
> optimisation, one of the AVL bits can be used for tracking this type of 
> fault.  When you update the mapping, Xen will decrease the 
> reference/sharing count of the previously shared page, and if the 
> refcount reaches zero free the page, and remove it from the hash table.
> 
> Jacob
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: InterSystems CACHE
> FREE OODBMS DOWNLOAD - A multidimensional database that combines
> robust object and relational technologies, making it a perfect match
> for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/xen-devel



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel