From patchwork Sat Jul 2 23:52:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 939672 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p620MrsT023474 for ; Sat, 2 Jul 2011 00:22:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750999Ab1GBAAW (ORCPT ); Fri, 1 Jul 2011 20:00:22 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:50462 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750788Ab1GBAAV (ORCPT ); Fri, 1 Jul 2011 20:00:21 -0400 Received: by wwe5 with SMTP id 5so3648131wwe.1 for ; Fri, 01 Jul 2011 17:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=BduSKRz2k9sy3lnrAO1QbASD3ZtPljpVZom04unN0Eo=; b=flwq2ROA6Wb2GSjTUDzSY26as0Kt5DwnYVw7klS6E7VtfG2cr5OlPj0Gy1WEGqpBV5 eR1n6I1cbM82G59EU08rX4kOZA4XwG3GgULcb4zqXBABj/5dqDHzJZnZYirXBSknhD3j 5Sb320KULU5YTwiELMOv8z9Opcah5DuYBYIBE= Received: by 10.216.65.18 with SMTP id e18mr1637123wed.23.1309564419814; Fri, 01 Jul 2011 16:53:39 -0700 (PDT) Received: from localhost.localdomain ([31.210.184.221]) by mx.google.com with ESMTPS id l53sm1858198weq.23.2011.07.01.16.53.34 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Jul 2011 16:53:39 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, Sasha Levin Subject: [PATCH v2 7/8] kvm tools: Advise memory allocated for guest RAM as KSM mergable Date: Sun, 3 Jul 2011 02:52:09 +0300 Message-Id: <1309650731-5796-7-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1309650731-5796-1-git-send-email-levinsasha928@gmail.com> References: <1309650731-5796-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 02 Jul 2011 00:22:54 +0000 (UTC) Signed-off-by: Sasha Levin --- tools/kvm/kvm.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index 23d31a3..2f5d633 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/kvm.c @@ -346,6 +346,8 @@ struct kvm *kvm__init(const char *kvm_dev, u64 ram_size, const char *name) if (kvm->ram_start == MAP_FAILED) die("out of memory"); + madvise(kvm->ram_start, kvm->ram_size, MADV_MERGEABLE); + ret = ioctl(kvm->vm_fd, KVM_CREATE_IRQCHIP); if (ret < 0) die_perror("KVM_CREATE_IRQCHIP ioctl");