From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zang Hongyong Subject: Re: [PATCH] kvm tools: Make the whole guest memory mergeable Date: Fri, 16 Dec 2011 15:02:38 +0800 Message-ID: <4EEAED0E.5050106@huawei.com> References: <1323997263-2031-1-git-send-email-zanghongyong@huawei.com> <1324014621.4496.3.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, penberg@kernel.org, xiaowei.yang@huawei.com, hanweidong@huawei.com, wusongwei@huawei.com, kongbo@huawei.com To: Sasha Levin Return-path: Received: from szxga01-in.huawei.com ([119.145.14.64]:35377 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751834Ab1LPHD6 (ORCPT ); Fri, 16 Dec 2011 02:03:58 -0500 Received: from huawei.com (szxga05-in [172.24.2.49]) by szxga05-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0LWA000ICBMLD7@szxga05-in.huawei.com> for kvm@vger.kernel.org; Fri, 16 Dec 2011 15:03:57 +0800 (CST) Received: from szxrg02-dlp.huawei.com ([172.24.2.119]) by szxga05-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0LWA00IKTBMLC8@szxga05-in.huawei.com> for kvm@vger.kernel.org; Fri, 16 Dec 2011 15:03:57 +0800 (CST) In-reply-to: <1324014621.4496.3.camel@lappy> Sender: kvm-owner@vger.kernel.org List-ID: =E4=BA=8E 2011/12/16,=E6=98=9F=E6=9C=9F=E4=BA=94 13:50, Sasha Levin =E5= =86=99=E9=81=93: > On Fri, 2011-12-16 at 09:01 +0800, zanghongyong@huawei.com wrote: >> If a guest's ram_size exceeds KVM_32BIT_GAP_START, the corresponding= kvm tool's >> virtual address size should be (ram_size + KVM_32BIT_GAP_SIZE), rath= er than ram_size. > You're right. > > There are more places than just the madvise() code which make the sam= e > error you've spotted (for example, the memslot allocation code), so > instead of trying to fix all of them I'd suggest to just update ram_s= ize > in kvm__arch_init() before allocating everything - that should fix al= l > of them at once. > Yes. There are other scenarios with the same error. However ram_size sometimes means real guest ram size, and sometimes=20 means virtual address size of kvm tool's user space. Shall we define a new variable?