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 A0817CA9EBC for ; Fri, 25 Oct 2019 16:30:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 77D9120663 for ; Fri, 25 Oct 2019 16:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572021046; bh=XN3xAz+czdXLsyki4/WdZ/IMk5xWphsk8nyvZO1GUu0=; h=To:Subject:Date:From:Cc:In-Reply-To:References:List-ID:From; b=cYpbXRS8vEo8t9bx2UQILRgaQDDNBdAWGK7YaStzOLNJ3JXLw/cMVHLMODAIOTD+U 0zo7kzOxy7IXOHOWTm29Fxrm9tg+HLigPa8XvRN714wR7ZOieoN3j3w9KT0HaykeC+ Sp/+e/HXBAHdpUdM6Kv/dgIzmDs8wyZLMlyqAU6Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633065AbfJYQap (ORCPT ); Fri, 25 Oct 2019 12:30:45 -0400 Received: from inca-roads.misterjones.org ([213.251.177.50]:42492 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733010AbfJYQao (ORCPT ); Fri, 25 Oct 2019 12:30:44 -0400 Received: from www-data by cheepnis.misterjones.org with local (Exim 4.80) (envelope-from ) id 1iO2Tk-0008W8-Nd; Fri, 25 Oct 2019 18:30:20 +0200 To: Sean Christopherson Subject: Re: [PATCH v3 00/15] 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: Fri, 25 Oct 2019 17:30:20 +0100 From: Marc Zyngier Cc: James Hogan , Paul Mackerras , Christian Borntraeger , Janosch Frank , Paolo Bonzini , =?UTF-8?Q?Radim_Kr=C4=8Dm=C3=A1=C5=99?= , David Hildenbrand , Cornelia Huck , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , James Morse , Julien Thierry , Suzuki K Poulose , , , , , , , Christoffer Dall In-Reply-To: <20191024230744.14543-1-sean.j.christopherson@intel.com> References: <20191024230744.14543-1-sean.j.christopherson@intel.com> Message-ID: <2fc05685467a01c2f1c2afeacefb2f68@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, rkrcmar@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 X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-10-25 00:07, 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 14/15 and 15/15. Patches > 1-13 > 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. I've finally found time to test this on a garden variety of arm64 boxes, and nothing caught fire. It surely must be doing something right! FWIW: Tested-by: Marc Zyngier M. -- Jazz is not dead. It just smells funny...