From patchwork Tue Jul 28 16:39:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Izik Eidus X-Patchwork-Id: 37839 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6SGbZrS002837 for ; Tue, 28 Jul 2009 16:37:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754548AbZG1Qg3 (ORCPT ); Tue, 28 Jul 2009 12:36:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753522AbZG1Qg3 (ORCPT ); Tue, 28 Jul 2009 12:36:29 -0400 Received: from mx2.redhat.com ([66.187.237.31]:55138 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753192AbZG1Qg2 convert rfc822-to-8bit (ORCPT ); Tue, 28 Jul 2009 12:36:28 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n6SGaTnI021949 for ; Tue, 28 Jul 2009 12:36:29 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6SGaS9N004502; Tue, 28 Jul 2009 12:36:28 -0400 Received: from woof.woof (dhcp-1-211.tlv.redhat.com [10.35.1.211]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6SGaQlC002969; Tue, 28 Jul 2009 12:36:27 -0400 Date: Tue, 28 Jul 2009 19:39:59 +0300 From: Izik Eidus To: kvm@vger.kernel.org, "Justin M. Forbes" , Mark McLoughlin Subject: kvm userspace: ksm support Message-ID: <20090728193959.49cc28b6@woof.woof> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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;