From: Tim Deegan Subject: Re: Copy-on write sharing Date: Thu, 31 May 2012 10:23:26 +0100 Message-ID: <20120531092326.GB62804@ocelot.phlegethon.org> References: <1338453571115-5709207.post@n5.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1338453571115-5709207.post@n5.nabble.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: zhangzhi Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hi, At 01:39 -0700 on 31 May (1338428371), zhangzhi wrote: > xen 4.0 release has said that it had a special feature of copy-on write > sharing of identical memory pages between VMs (HVM only). > I just wanna know the source code that illustrate this feature. The code inside the hypervisor lives in xen/arch/x86/mm/, mostly in the file mem_sharing.c. The user-space interface is in libxc, in tools/libxc/xc_memshr.c An example program that uses it is tools/tests/mem-sharing/memshrtool.c. This feature is not built in to the higher-level tools (libxl &c) at the moment; originally there were extensions to blktap that could automatically share pages that were read from disk if the VMs' disks came from the same source image, but I think that's all bitrotted. If anyone wanted to try to get that working again, I'm sure it would be welcome! Cheers, Tim.