Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp582682ybg; Wed, 23 Oct 2019 02:41:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLR7SlopVHjB2uDi4EeztrSse93NIa7nSmww5HXNL0lCYPpKv9i8ISz281HDo6QBlyO/3+ X-Received: by 2002:a05:6402:20c:: with SMTP id t12mr12524637edv.109.1571823682008; Wed, 23 Oct 2019 02:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571823682; cv=none; d=google.com; s=arc-20160816; b=TF6j2WONO0BSAsAJHgxIlgJ4PlvDD3s+40rEfPufyESDBOR7iCuJb8RbDj64UwmUT0 YxGDQOJAL4YouI4yofPxsEuQzssUr/CKPqG5PvQPqVN3BLdlrYHwJqlafLQUKKcqqtYg eT+mAmrE691YXmK1hXFucAAcCnm7Hrq9ymXYK5nmPFxJb0cyNNQlt6lDiPBhRU8L2MHR lOC2FNWaeha4A2XnlXOGIVgJgFsAFLrOibiaQUQK2Fi1v4bbV+0pbtDAMfR5W7dUc3Up LlOHPrdFsAYM0BKjckiaQxk1G87dPDA2jM5yKE4WZjQcTJjy2P4982DiE3MvZv1/7RL1 Vi3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=uShl7RLUS92dMO/tQI5cF4iYcH2KsSThIzXA3xIFNDc=; b=fUmqL8u9JKQ2rvBgNYMbtJK2y8yl5cIywJ1yiTIIWwzciASM3vkNKdWClLgSJ1jupa zZhZ21x8+Cq4AieH7hRP+ZWdiy3vOab/yVvKf+BGuKJZ9LdLI9KTvxD/V1qW4aQsPYEW Oe6wLunjH0zPzO3/izHz3QHlBlQoyRoJ7J3n2VwsAjY2kyK4mmH4ZhQvcP/6DbLd1mEF f3zcdsRvLKjEU/iuYGobrRJXx1eFrd1j+bE6lwI5DlT3mXVuT/I25QaCMGols0dlKNI0 EGx4vylOYj44FNxQJNqkt1FkCmAPceLd5rA3LwS6oGmSxy40wZpxC38UJBYtK+iU/I47 psfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x45si14504851edd.388.2019.10.23.02.40.58; Wed, 23 Oct 2019 02:41:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403957AbfJWJkP (ORCPT + 99 others); Wed, 23 Oct 2019 05:40:15 -0400 Received: from [217.140.110.172] ([217.140.110.172]:46342 "EHLO foss.arm.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S2403840AbfJWJkO (ORCPT ); Wed, 23 Oct 2019 05:40:14 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7E4F91688; Wed, 23 Oct 2019 02:39:56 -0700 (PDT) Received: from localhost (e113682-lin.copenhagen.arm.com [10.32.145.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 07AC83F718; Wed, 23 Oct 2019 02:39:55 -0700 (PDT) Date: Wed, 23 Oct 2019 11:39:54 +0200 From: Christoffer Dall To: Sean Christopherson Cc: James Hogan , Paul Mackerras , Christian Borntraeger , Janosch Frank , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Marc Zyngier , linux-arm-kernel@lists.infradead.org, Wanpeng Li , kvm@vger.kernel.org, David Hildenbrand , Joerg Roedel , Cornelia Huck , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, Vitaly Kuznetsov , kvmarm@lists.cs.columbia.edu, Jim Mattson Subject: Re: [PATCH v2 00/15] KVM: Dynamically size memslot arrays Message-ID: <20191023093954.GH2652@e113682-lin.lund.arm.com> References: <20191022003537.13013-1-sean.j.christopherson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191022003537.13013-1-sean.j.christopherson@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 21, 2019 at 05:35:22PM -0700, Sean Christopherson wrote: > The end goal of this series is to dynamically size the memslot array so > that KVM allocates memory based on the number of memslots in use, as > opposed to unconditionally allocating memory for the maximum number of > memslots. On x86, each memslot consumes 88 bytes, and so with 2 address > spaces of 512 memslots, each VM consumes ~90k bytes for the memslots. > E.g. given a VM that uses a total of 30 memslots, dynamic sizing reduces > the memory footprint from 90k to ~2.6k bytes. > > The changes required to support dynamic sizing are relatively small, > e.g. are essentially contained in patches 12/13 and 13/13. Patches 1-11 > clean up the memslot code, which has gotten quite crusy, especially > __kvm_set_memory_region(). The clean up is likely not strictly necessary > to switch to dynamic sizing, but I didn't have a remotely reasonable > level of confidence in the correctness of the dynamic sizing without first > doing the clean up. > > Testing, especially non-x86 platforms, would be greatly appreciated. The > non-x86 changes are for all intents and purposes untested, e.g. I compile > tested pieces of the code by copying them into x86, but that's it. In > theory, the vast majority of the functional changes are arch agnostic, in > theory... I've built this for arm/arm64, and I've ran my usual set of tests which pass fine. I've also run the selftest framework's tests for the dirty logging and the migration loop test for arm64, and they pass fine. You can add my (for arm64): Tested-by: Christoffer Dall