From: Brian Jackson Subject: Re: kvm userspace: ksm support Date: Mon, 3 Aug 2009 13:08:24 -0500 Message-ID: <200908031308.24804.iggy@theiggy.com> References: <20090728193959.49cc28b6@woof.woof> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Izik Eidus Return-path: Received: from theiggy.com ([66.220.1.110]:55427 "EHLO mail.theiggy.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752931AbZHCSIh (ORCPT ); Mon, 3 Aug 2009 14:08:37 -0400 In-Reply-To: <20090728193959.49cc28b6@woof.woof> Sender: kvm-owner@vger.kernel.org List-ID: If someone wanted to play around with ksm in qemu-kvm-0.x.x would it be as simple as adding the below additions to kvm_setup_guest_memory in kvm-all.c (and adding the necessary kernel changes of course)? On Tuesday 28 July 2009 11:39:59 am Izik Eidus wrote: > This patch is not for inclusion just rfc. > > Thanks. > > > From 1297b86aa257100b3d819df9f9f0932bf4f7f49d Mon Sep 17 00:00:00 2001 > From: Izik Eidus > Date: Tue, 28 Jul 2009 19:14:26 +0300 > Subject: [PATCH] kvm userspace: ksm support > > rfc for ksm support to kvm userpsace. > > thanks > > Signed-off-by: Izik Eidus > --- > exec.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/exec.c b/exec.c > index f6d9ec9..375cc18 100644 > --- a/exec.c > +++ b/exec.c > @@ -2595,6 +2595,9 @@ ram_addr_t qemu_ram_alloc(ram_addr_t size) > new_block->host = file_ram_alloc(size, mem_path); > if (!new_block->host) { > new_block->host = qemu_vmalloc(size); > +#ifdef MADV_MERGEABLE > + madvise(new_block->host, size, MADV_MERGEABLE); > +#endif > } > new_block->offset = last_ram_offset; > new_block->length = size;