Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759364AbcCDJIz (ORCPT ); Fri, 4 Mar 2016 04:08:55 -0500 Received: from mga04.intel.com ([192.55.52.120]:30277 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758790AbcCDJIs convert rfc822-to-8bit (ORCPT ); Fri, 4 Mar 2016 04:08:48 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,535,1449561600"; d="scan'208";a="757979595" From: "Li, Liang Z" To: Roman Kagan CC: "Dr. David Alan Gilbert" , "ehabkost@redhat.com" , "kvm@vger.kernel.org" , "mst@redhat.com" , "quintela@redhat.com" , "linux-kernel@vger.kernel.org" , "qemu-devel@nongnu.org" , "linux-mm@kvack.org" , "amit.shah@redhat.com" , "pbonzini@redhat.com" , "akpm@linux-foundation.org" , "virtualization@lists.linux-foundation.org" , "rth@twiddle.net" Subject: RE: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization Thread-Topic: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization Thread-Index: AQHRdTqPjTxTnYWKZEWM4lf/HjT6rZ9HeJiAgAEJK0D//+lWAIAAiTOQ Date: Fri, 4 Mar 2016 09:08:44 +0000 Message-ID: References: <1457001868-15949-1-git-send-email-liang.z.li@intel.com> <20160303174615.GF2115@work-vm> <20160304081411.GD9100@rkaganb.sw.ru> In-Reply-To: <20160304081411.GD9100@rkaganb.sw.ru> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGJjOTdiOTctNDIxNS00YjAwLTk0N2QtMzhjYzUyOTdhZjdhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlwvTmFCQWUyTnphaXR5UTMrYzl4NDZCbFlWTllQUExXTU91WUlzbWNnU2x3PSJ9 x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1790 Lines: 40 > On Fri, Mar 04, 2016 at 01:52:53AM +0000, Li, Liang Z wrote: > > > I wonder if it would be possible to avoid the kernel changes by > > > parsing /proc/self/pagemap - if that can be used to detect > > > unmapped/zero mapped pages in the guest ram, would it achieve the > same result? > > > > Only detect the unmapped/zero mapped pages is not enough. Consider > the > > situation like case 2, it can't achieve the same result. > > Your case 2 doesn't exist in the real world. If people could stop their main > memory consumer in the guest prior to migration they wouldn't need live > migration at all. The case 2 is just a simplified scenario, not a real case. As long as the guest's memory usage does not keep increasing, or not always run out, it can be covered by the case 2. > I tend to think you can safely assume there's no free memory in the guest, so > there's little point optimizing for it. If this is true, we should not inflate the balloon either. > OTOH it makes perfect sense optimizing for the unmapped memory that's > made up, in particular, by the ballon, and consider inflating the balloon right > before migration unless you already maintain it at the optimal size for other > reasons (like e.g. a global resource manager optimizing the VM density). > Yes, I believe the current balloon works and it's simple. Do you take the performance impact for consideration? For and 8G guest, it takes about 5s to inflating the balloon. But it only takes 20ms to traverse the free_list and construct the free pages bitmap. In this period, the guest are very busy. By inflating the balloon, all the guest's pages are still be processed (zero page checking). The only advantage of ' inflating the balloon before live migration' is simple, nothing more. Liang > Roman.