From patchwork Wed Dec 12 04:14:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Mackerras X-Patchwork-Id: 10725527 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3EC6F13BF for ; Wed, 12 Dec 2018 04:17:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D42D1FF40 for ; Wed, 12 Dec 2018 04:17:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2176629FA1; Wed, 12 Dec 2018 04:17:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB7501FF40 for ; Wed, 12 Dec 2018 04:17:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726432AbeLLERf (ORCPT ); Tue, 11 Dec 2018 23:17:35 -0500 Received: from ozlabs.org ([203.11.71.1]:42923 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726251AbeLLERf (ORCPT ); Tue, 11 Dec 2018 23:17:35 -0500 Received: by ozlabs.org (Postfix, from userid 1003) id 43F3SF20npz9s3Z; Wed, 12 Dec 2018 15:17:33 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1544588253; bh=hHivuYidpzQ6YbtsjPpny5CaPwurDwWZiclk8HAmWuE=; h=Date:From:To:Cc:Subject:From; b=q8pJK9YXgDsmN1r/3fN8LZ7xnUeVyhwFcLv9iHq5JMKxCTCvfQXsfVYkBHETtuPX/ RwIE1yB6haOO22iQnUPiIRfPc77TIpIETfYeMICBE4jJZAkPxXY1PYDMlsnhKeP9aV HarfVfxabyJKzgYWwhdAtLDdssp/FTjn7XR74VKZ0o1Q07dDBTEh+Y5dewqEKOV+mH /H2n+fG8tFnMcMcFLR3i7InEmKsA3hTtkrWAN5iKcMHWGxgtnf/yaqkmOvwfYgY/md Pi5+Pv5gaUw6O/2/XrYEfK9OMfHNQ9yXU+R5iWrBe9ZlTCF1JmbvLdnquicZWguHAK ZfNr4Ppr8YACg== Date: Wed, 12 Dec 2018 15:14:30 +1100 From: Paul Mackerras To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Cc: David Gibson Subject: [PATCH 0/4] KVM: PPC: Book3S HV: Improve live migration of radix guests Message-ID: <20181212041430.GA22265@blackberry> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We have observed that live migration of radix guests tends to converge slowly and sometimes doesn't converge at all. This appears to be due largely to the fact that if the host is using transparent huge pages, page dirtiness only gets tracked with a 2MB granularity for the parts of the guest memory that are mapped using 2MB pages. The fix is to break down the mappings in the partition-scoped page tables to 64k pages (or 4k pages if 4k is the system page size). This is accomplished by flushing the partition-scoped page tables when turning dirty page tracking on or off, and by only inserting small-page PTEs into the partition-scoped page tables while dirty page tracking is enabled. Paul. arch/powerpc/include/asm/kvm_book3s.h | 11 +++++----- arch/powerpc/include/asm/kvm_book3s_64.h | 2 +- arch/powerpc/include/asm/kvm_ppc.h | 6 ++++-- arch/powerpc/kvm/book3s.c | 5 +++-- arch/powerpc/kvm/book3s_64_mmu_hv.c | 9 ++++---- arch/powerpc/kvm/book3s_64_mmu_radix.c | 37 ++++++++++++++++++++++++++------ arch/powerpc/kvm/book3s_hv.c | 20 ++++++++++++++++- arch/powerpc/kvm/book3s_hv_nested.c | 2 +- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 2 +- arch/powerpc/kvm/book3s_pr.c | 3 ++- arch/powerpc/kvm/powerpc.c | 2 +- 11 files changed, 73 insertions(+), 26 deletions(-)