From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9520C2D0BF for ; Wed, 18 Dec 2019 18:11:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 956352465E for ; Wed, 18 Dec 2019 18:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576692675; bh=xpO8sxy0GcqSsp0Qt7Kh/TkeVXsXU+WoPhma+gWNuEY=; h=To:Subject:Date:From:Cc:In-Reply-To:References:List-ID:From; b=xiCTPlKixKJHsSVjjF5TM6HzCkq+362eD/sPHrEN+OP6FTYy4VqVULv7y7mLf/p/O DKFe+u6KAtDgA2voVYBZBxQGypkvzwbj64OlEUiMJ3h11gG57SaTa53Z7gzbHjlYDU VrnR8heV9lkgSE66Y8bIGeIzNMSz9OJX0WgsRrDI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727198AbfLRSLM (ORCPT ); Wed, 18 Dec 2019 13:11:12 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:44619 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726960AbfLRSLM (ORCPT ); Wed, 18 Dec 2019 13:11:12 -0500 Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1ihdmZ-0007pw-8W; Wed, 18 Dec 2019 19:10:47 +0100 To: Sean Christopherson Subject: Re: [PATCH v4 00/19] KVM: Dynamically size memslot arrays X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 18 Dec 2019 18:10:47 +0000 From: Marc Zyngier Cc: James Hogan , Paul Mackerras , Christian Borntraeger , Janosch Frank , Paolo Bonzini , David Hildenbrand , Cornelia Huck , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , James Morse , Julien Thierry , Suzuki K Poulose , , , , , , , Christoffer Dall , =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= In-Reply-To: <20191217204041.10815-1-sean.j.christopherson@intel.com> References: <20191217204041.10815-1-sean.j.christopherson@intel.com> Message-ID: <3a6b03cc1300bc3cffd3904e22c09478@www.loen.fr> X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/0.7.2 X-SA-Exim-Connect-IP: X-SA-Exim-Rcpt-To: sean.j.christopherson@intel.com, jhogan@kernel.org, paulus@ozlabs.org, borntraeger@de.ibm.com, frankja@linux.ibm.com, pbonzini@redhat.com, david@redhat.com, cohuck@redhat.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, linux-mips@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, christoffer.dall@arm.com, f4bug@amsat.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 2019-12-17 20:40, 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 17/19 and 18/19. > > Patches 2-16 clean up the memslot code, which has gotten quite > crusty, > 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. > > The only functional change in v4 is the addition of an x86-specific > bug > fix in x86's handling of KVM_MR_MOVE. The bug fix is not directly > related > to dynamically allocating memslots, but it has subtle and hidden > conflicts > with the cleanup patches, and the fix is higher priority than > anything > else in the series, i.e. should be merged first. > > On non-x86 architectures, v3 and v4 should be functionally > equivalent, > the only non-x86 change in v4 is the dropping of a "const" in > kvm_arch_commit_memory_region(). Gave it another go on top of 5.5-rc2 on an arm64 box, and nothing exploded. So thumbs up from me. Thanks, M. -- Jazz is not dead. It just smells funny...