From patchwork Wed Jun 29 18:02:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 929912 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 p5TI4kqW005646 for ; Wed, 29 Jun 2011 18:04:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756993Ab1F2SEj (ORCPT ); Wed, 29 Jun 2011 14:04:39 -0400 Received: from mail-qy0-f174.google.com ([209.85.216.174]:39723 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756945Ab1F2SEi (ORCPT ); Wed, 29 Jun 2011 14:04:38 -0400 Received: by mail-qy0-f174.google.com with SMTP id 29so2667320qyk.19 for ; Wed, 29 Jun 2011 11:04:38 -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=+MhBlM3uSrCsznm40nSz4ED3XkdwkaHZoOy9mQOjbEA=; b=UoFl1zFk1Jow/1hE86yacm7O2ACcNiEwpNzvxyPTXBwGjri0EfhV2TdA1Z93JK03G+ h6mZoX6Y2HjOHFoWohgdPrSTmSZsCps2kuqAx4hki/yrNogl/kGaH6aQ50ZXdBb/R92b CXfTEH3dLC0F/aCuF05cQ8ehNzsnJkPjE4R5E= Received: by 10.224.204.131 with SMTP id fm3mr792361qab.163.1309370678056; Wed, 29 Jun 2011 11:04:38 -0700 (PDT) Received: from localhost.localdomain (c-71-232-157-243.hsd1.ma.comcast.net [71.232.157.243]) by mx.google.com with ESMTPS id e18sm1067677qcs.29.2011.06.29.11.04.36 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Jun 2011 11:04:37 -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 7/9] kvm tools: Advise memory allocated for guest RAM as KSM mergable Date: Wed, 29 Jun 2011 14:02:16 -0400 Message-Id: <1309370538-7947-7-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1309370538-7947-1-git-send-email-levinsasha928@gmail.com> References: <1309370538-7947-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]); Wed, 29 Jun 2011 18:04:46 +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 4f723a6..15bcf08 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/kvm.c @@ -345,6 +345,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");