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
|