From patchwork Sun Oct 4 12:16:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Izik Eidus X-Patchwork-Id: 51588 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 n94CHF4A025297 for ; Sun, 4 Oct 2009 12:17:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754474AbZJDMJn (ORCPT ); Sun, 4 Oct 2009 08:09:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754309AbZJDMJn (ORCPT ); Sun, 4 Oct 2009 08:09:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31368 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753837AbZJDMJm convert rfc822-to-8bit (ORCPT ); Sun, 4 Oct 2009 08:09:42 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n94C9GBV021160 for ; Sun, 4 Oct 2009 08:09:16 -0400 Received: from woof.woof (dhcp-1-211.tlv.redhat.com [10.35.1.211]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n94C9CwI005070 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 4 Oct 2009 08:09:15 -0400 Date: Sun, 4 Oct 2009 14:16:07 +0200 From: Izik Eidus To: kvm@vger.kernel.org Subject: PATCH: kvm-userspace: ksm support Message-ID: <20091004141607.549fe80a@woof.woof> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/exec.c b/exec.c index 5c9edf7..406d2cb 100644 --- a/exec.c +++ b/exec.c @@ -2538,6 +2538,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;