From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752798AbdARKRE (ORCPT ); Wed, 18 Jan 2017 05:17:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33284 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752774AbdARKRB (ORCPT ); Wed, 18 Jan 2017 05:17:01 -0500 Subject: Re: [PATCH v6 kernel 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration To: Liang Li , kvm@vger.kernel.org References: <1482303148-22059-1-git-send-email-liang.z.li@intel.com> Cc: virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, amit.shah@redhat.com, dave.hansen@intel.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, mst@redhat.com, aarcange@redhat.com, dgilbert@redhat.com, quintela@redhat.com From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <2a32f616-25a8-ba5a-f74c-d619fc8ab333@redhat.com> Date: Wed, 18 Jan 2017 11:09:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1482303148-22059-1-git-send-email-liang.z.li@intel.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 18 Jan 2017 10:09:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 21.12.2016 um 07:52 schrieb Liang Li: > This patch set contains two parts of changes to the virtio-balloon. > > One is the change for speeding up the inflating & deflating process, > the main idea of this optimization is to use {pfn|length} to present > the page information instead of the PFNs, to reduce the overhead of > virtio data transmission, address translation and madvise(). This can > help to improve the performance by about 85%. > > Another change is for speeding up live migration. By skipping process > guest's unused pages in the first round of data copy, to reduce needless > data processing, this can help to save quite a lot of CPU cycles and > network bandwidth. We put guest's unused page information in a > {pfn|length} array and send it to host with the virt queue of > virtio-balloon. For an idle guest with 8GB RAM, this can help to shorten > the total live migration time from 2Sec to about 500ms in 10Gbps network > environment. For an guest with quite a lot of page cache and with little > unused pages, it's possible to let the guest drop it's page cache before > live migration, this case can benefit from this new feature too. I agree that both changes make sense (although the second change just smells very racy, as you also pointed out in the patch description), however I am not sure if virtio-balloon is really the right place for the latter change. virtio-balloon is all about ballooning, nothing else. What you're doing is using it as a way to communicate balloon-unrelated data from/to the hypervisor. Yes, it is also about guest memory, but completely unrelated to the purpose of the balloon device. Maybe using virtio-balloon for this purpose is okay - I have mixed feelings (especially as I can't tell where else this could go). I would like to get a second opinion on this. -- David